开启远程连接服务导入
exec sp_configure ‘show advanced options’,1
reconfigure
exec sp_configure ‘Ad Hoc Distributed Queries’,1
reconfigure
关闭远程服务导入
exec sp_configure ‘Ad Hoc Distributed Queries’,0
reconfigure
exec sp_configure ‘show advanced options’,0
reconfigure
导入SQL
INSERT INTO [dbo].[VW_FAC_PFS_CONTRACT]
SELECT A.* FROM
OPENROWSET(‘SQLOLEDB’,‘SERVER=192.168.6.2;uid=PFS_INC;pwd=Porsche911!@#;Database=PCBI’,
‘SELECT * FROM [dbo].[VW_FAC_PFS_CONTRACT] WHERE BUSINESS_TYPE=N’‘贴息活动’’ and CAMPAIGN_PROGRAM_NAME like ‘’%Special%’’ and IS_LOCKED=1 and IS_CANCELLATION=1 and NEW_USED=1 ') AS A