Hello Sir
I have databases named LMS , Stud . In LMS i have two tables and I want to copy the tables of LMS to Stud. what will be the command.?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
EhteshamPosted May 14, 2012, 8:28 AM
INSERT LMS.[schema].table1 SELECT * FROM Stud.[schema].table1
Kunal VaishyaPosted May 14, 2012, 7:39 AM
In MsSql you can use another database using Link server
First Add Link Server and Use It
Example
sp_addlinkedserver [ @server= ] 'server' [ , [ @srvproduct= ] 'product_name' ] [ , [ @provider= ] 'provider_name' ] [ , [ @datasrc= ] 'data_source' ] [ , [ @location= ] 'location' ] [ , [ @provstr= ] 'provider_string' ] [ , [ @catalog= ] 'catalog' ]
try this
More references refer this
http://www.execsql.com/post/linked-servers-in-sql-server-2005
http://blog.sqlauthority.com/2007/10/06/sql-server-executing-remote-stored-procedure-calling-stored-procedure-on-linked-server/
http://msdn.microsoft.com/en-us/library/ms190479.aspx