Saturday, August 31, 2013

OpenData Source Insert

Hi Priya,


With your requirement, we can specify the column lists in both of the insert sub phrase and the select sub phrase, for example:



insert into [TestServerTable] (col1,col2)
select col1,col2 from OPENDATASOURCE('SQLNCLI',
'Data Source=LinkedServerName;Integrated Security=SSPI')
.[DBname].[SchemaName].[DevServerTable]

In this way, the identity column will be filled with identity value manually, and status column will be filled with null (please make sure this column allows null, otherwise, please provide a default value for it).




Allen Li

TechNet Community Support



No comments:

Post a Comment