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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server Newbie - database link question

Status
Not open for further replies.

TWillard

Programmer
Joined
Apr 26, 2001
Messages
263
Location
US
I am trying to copy data from a SQL SERVER production database to a SQL SERVER development database. The datbase structures are exactly the same. However, the development already contains some data that cannot be deleted. Therefore I can not complete copy the database tables over.

I am confident enough in my sql skills that I could explicit bring it over and insert it. If I were using an Oracle database, I would create a database link. I would then execute sql statements and import my data. Are database links supported in SQL Server? If so, could someone provide some syntax on how to create and use them.

Thanks,

Tim

 

If the databases are on the same server you merely reference the table using the fully qualified name - dbname.dbo.tablename.

If on different servers, you can link if using SQL 7 or 2000. See Linked Server in SQL BOL for details. You can use the sp_addlinkedserver stored procedure to add linked servers. It is also documented in BOL. After linking you can reference a table with servername.dbname.dbo.tablename. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top