I need to copy data from a particular column in a table and transfer to another table however, this involves moving from one SQL Server instance to another instance.
Does anyone have any tips for achieving this?
I need to copy data from a particular column in a table and transfer to another table however, this involves moving from one SQL Server instance to another instance.
Does anyone have any tips for achieving this?
To transfer data from one instance to another you have 3 choices:
You can link the 2 servers and use a query to insert the data.
To link the servers you can use the MSSQL procedures, like so:
EXEC sp_addlinkedserver @server='ServerName1', @srvproduct='', @provider='SQLNCLI', @datasrc='10.10.10.10'
EXEC sp_addlinkedsrvlogin 'ServerName1', 'false', NULL, 'username', 'password'
where ServerName1 is the name of the remote SQL server and @datasrc would be the ip address/dns name
To copy the data you can use a simple query like this one:
insert into [ServerName1].DatabaseName.dbo.TableName(column1,column2)
select Column1, null from LocalTableName
It's an example of course, since you didn't post the table setups. You would probably need to adjust it to suit your needs.