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)
 copy table data from remote sql server to local sq

Author  Topic 

-Dman100-
Posting Yak Master

210 Posts

Posted - 2008-10-26 : 16:01:52
I need to move some updated table data from a table on a remote sql server to my local development instance of sql server.

The remote sql server is running Sql Server 2005 and my local version is running Sql Server Management Studio Express 2005.

I have the remote sql server registered on my local server.

I was trying to run the following statement to copy the data:


INSERT INTO MYSERVERNAME\SQLEXPRESS.Public_Data.dbo.web_item SELECT * FROM
Aus-Sql03.Public_Data.dbo.web_item

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '\'.
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '-'.

Thanks for any help.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2008-10-26 : 17:03:55
Try this:
INSERT INTO [MYSERVERNAME\SQLEXPRESS].Public_Data.dbo.web_item SELECT * FROM
[Aus-Sql03].Public_Data.dbo.web_item

And when you are actually executing your statement on your sqlexpress-server then you don't need the server name.
INSERT INTO Public_Data.dbo.web_item SELECT * FROM
[Aus-Sql03].Public_Data.dbo.web_item

Webfred

No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -