Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Data From One Platform/Database To Another?

Status
Not open for further replies.

jiggyg

Programmer
Oct 1, 2007
61
US
Hello Again!

I need to copy data from our Staging Platform (STAGESQL01) to the Quality Platform (STAGESQL02)...db name in each is "VEG" and table name is AreaEval...

I know I need to do:

INSERT INTO AreaEval
SELECT * FROM AreaEval


Just not sure how to do it using two different platforms...

So, something like:

INSERT INTO [STAGESQL02].[VEG].[AreaEval]
SELECT * FROM [STAGESQL01].[VEG].[AreaEval]


But, with the correct Syntax....

Thanks!
-jiggyg
 
In order to do this, you should set up a linked server. There are lots of sites that explain how to do this. As a starting point, I suggest you look in to: [!]sp_addlinkedserver[/!]

Your syntax is a little off. When referencing a linked server, you need to use a 4 part syntax.

Server.Database.schema.table

The schema is usually dbo, so...

NSERT INTO [STAGESQL02].[VEG].[!]dbo.[/!][AreaEval]
SELECT * FROM [STAGESQL01].[VEG].[!]dbo.[/!][AreaEval]



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
I assume that STAGESQL0x are servers name. The actual statements should look like this:
Code:
INSERT INTO STAGESQL02.VEG.dbo.AreaEval
SELECT * FROM STAGESQL01.VEG.dbo.AreaEval
You must have linked server to do this.

Other way is to use Export/Import routine of SSMS or EM or build DTS package.

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
Microsoft MVP VFP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top