SharpDeveloper
Copy Data from One SQL Instance to Another
When using SQL Server Management Studio you might want to copy data from one DB to another (using just a SELECT and INSERT statement)
It’s so easy you won’t believe it
sp_addlinkedserver @server='192.168.123.456', @provider='SQLNCLI', @srvproduct='',@provstr='User Id=sa; Password=are-you-crazy-to-use-sa' insert into [192.168.123.456].MYDB.dbo.tblRecords select * from MYDB.dbo.tblRecords
and when you are done
sp_dropserver [192.168.123.456]
References:
sp_addlinkedserver on MSDN
Related Reading:
Other Interesting Posts
5 Responses to Copy Data from One SQL Instance to Another
Leave a Reply Cancel reply
-
Articles
- January 2011
- April 2010
- March 2010
- February 2010
- January 2010
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- February 2009
- December 2008
- November 2008
- October 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
-
Meta








error
Msg 208, Level 16, State 1, Line 4
Invalid object name ‘BuiltUP.dbo.tblRecords’.
abhijit thats just an example using example tables, you have to use the real table name you want!
sp_addlinkedserver @server=’192.168.2.134′, @provider=’SQLNCLI’,
@srvproduct=”,@provstr=’User Id=sa; Password=saptech@123′
insert into [192.168.2.134].BuiltUP.dbo.tblRecords
select * from BuiltUP.dbo.tblRecords
Please tell me thats not your real sa password
hahahaha