Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 export data one server db to another server db

Author  Topic 

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2011-01-05 : 06:46:57
Hi Member
i have two different sql server one is sql2005 version 9.00.4035.00 or second is sql2008 version 10.0.2531.0 of two different machines with two different database but some same table definition.
i have export data of these table of first server database to second server database tables.
i can write a store procedure of this condition. so how i can write this scenario.anybody write the sp of this condition.
both server instance are connect to each other in smo

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2011-01-05 : 13:29:50
It's not clear from your post if you need to move the data or if you already have moved it. If it's the former, you could define a linked server on the destination server which references the source server. From there you can write a simple INSERT/SELECT statement using the full four part name for the source.

insert into MyTable (blah, blah, blah)
select (blah, blah, blah)
from MyLinkedServer.YourDB.YourSchema.YourTable

HTH

=======================================
Elitism is the slur directed at merit by mediocrity. -Sydney J. Harris, journalist (1917-1986)
Go to Top of Page
   

- Advertisement -