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?
So far i have tried the following in [localhost/SQLEXPRESS]
EXEC sp_addlinkedserver [abcwebservices\SQLEXPRESS]', @srvproduct='', @provider='SQLNCLI', @datasrc='abcwebservices\SQLEXPRESS'
Followed by the script below to transfer the cloumn data from one table to the next;
INSERT INTO [ABCWEBSERVICES\SQLEXPRESS].CPM.dbo.fct_Project([Proj_No],[CreateDate2])
SELECT [CreateDate2] FROM [localhost\SQLEXPRESS].CPM.dbo.fct_Project;
However this produces the following error message:
The statement has been terminated.
Msg 515, Level 16, State 2, Line 1
Cannot insert the value NULL into column 'Proj_No', table 'CPM.dbo.fct_Project'; column does not allow nulls. INSERT fails.
Why is this occuring when all i intend to do is copy createdate2 in one table to createdate2 in another table