Click here to Skip to main content
15,923,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Please enlighten me on how to copy the schema and data of one database which is in one server to other database present on different server in MS SQL Server 2008R@.



Thanks in advance.
Posted
Comments
RedDk 25-Jul-13 15:23pm    
Just a tip ... since SCHEMA is NOT on the sys.object list of objects (should be IMHO), using SELECT * FROM INFORMATION_SCHEMA.SCHEMATA is the quickest way to "compile" a list of said structs ...

Create a linked server in your current server, where you want your data to be pulled...

Then execute the below query in your current server, whichever DB you want:

SQL
Insert into MyCurrentDB.Schema.TableName 
Select * from LinkedServer.RemoteServerDB.Schema.TableName with (nolock)


It should do the trick.

You can also try the Import Export Wizard in SSMS.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900