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)
 My question

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2007-01-03 : 14:19:35
Vardhan writes "Hi

I want to write a select query in sqlserver2005 to select rows from remote sqlserver2005-> database -> table and insert into local sql server 2005 ->database->tables

is it possible or not?"

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-01-03 : 14:23:57
Yes it's possible. You just need to use a linked server:

INSERT INTO YourLocalTable(Column1, Column2)
SELECT Column1, Column2
FROM LinkedServerName.DatabaseName.ObjectOwner.YourRemoteTable

Tara Kizer
Go to Top of Page
   

- Advertisement -