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)
 Insert Query

Author  Topic 

JezLisle
Posting Yak Master

132 Posts

Posted - 2009-09-08 : 06:21:36
How is it possible to run a select section of an Insert query from a different server?

I thought about using this way SELECT ..... FROM [MyServerName].[MyDatabaseName].[dbo].[MyTable]

but using this, errors and tells me this below
Msg 7202, Level 11, State 2, Line 1
Could not find server 'MyServerName' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.

How can I get around this?


senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-09-08 : 06:28:34
Ya u can do, but u must add as linked server!

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

ra.shinde
Posting Yak Master

103 Posts

Posted - 2009-09-08 : 06:29:47
quote:
Originally posted by JezLisle

How is it possible to run a select section of an Insert query from a different server?

I thought about using this way SELECT ..... FROM [MyServerName].[MyDatabaseName].[dbo].[MyTable]

but using this, errors and tells me this below
Msg 7202, Level 11, State 2, Line 1
Could not find server 'MyServerName' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.

How can I get around this?






Add different server as Linked server.

Rahul Shinde
Go to Top of Page

JezLisle
Posting Yak Master

132 Posts

Posted - 2009-09-08 : 06:36:38
How can I do this?
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-09-08 : 06:38:35
quote:
Originally posted by JezLisle

How can I do this?





Go through google

http://www.google.co.in/#hl=en&source=hp&q=linked+server+sql+2005&btnG=Google+Search&meta=&aq=2&oq=Linked+server&fp=f1c6734d2f414fff

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page
   

- Advertisement -