时间:2021-07-01 10:21:17 帮助过:51人阅读
采用导入函数变一下可快很多,只是时间函数怎么导不知。希望有人指。本方案是引用网上的非我之功 DECLARE @Sql VARCHAR( 1000 ) DECLARE @organizationID VARCHAR( 10 ) SELECT @organizationID = (SELECT ORGANIZATION_ID FROM MYORGS WHERE ORGANIZATION_NA
采用导入函数变一下可快很多,只是时间函数怎么导不知。希望有人指。本方案是引用网上的非我之功
DECLARE @Sql VARCHAR(1000)
DECLARE @organizationID VARCHAR(10)
SELECT @organizationID = (SELECT ORGANIZATION_ID FROM MYORGS WHERE ORGANIZATION_NAME = 'MMT')
SET @Sql = 'SELECT * from 表名 where organization_id ='+@organizationID
SET @Sql = 'SELECT * FROM OPENQUERY(数据库名, ''' + REPLACE(@Sql, '''', '''''') + ''')'
EXEC(@Sql)