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!

How do I refer to two differnt severs 1

Status
Not open for further replies.

DougP

MIS
Joined
Dec 13, 1999
Messages
5,985
Location
US
We have a SQL server 7 database on our PDC and another one on our Internet WEBsite
the Home one is called SmallbServer
The Internet one is Called xx.xx.xx.xx

In Query Analyser I want to run 4 commands

1st
Use Universal ' This is on the local server
' run a DTS package to copy records from Access to SQL

2nd
Use universal1_db ' This is on the Internet
Delete from [Copy-Partmaster Lite]

3nd
Use Universal ' This is on the local server
'run DTS pacakge to copy records from Local server to Internet server

4th
Use universal1_db ' This is on the Internet
Delete From [Copy-PartMaster Lite old]
-------------------------------------
I have the DTS packages created and they work fine.

Now I have to open the Query analyser while I am setting on the Internet server or I get and error saying:

Server: Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'universal1_db'. No entry found with that name. Make sure that the name is entered correctly.

So I want to open Query analyser from the local Server and have it run the four commands on the correct SQL Servers.

TIA






DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
You need to have the servers linked.

Check out sp_addlinkedserver and sp_addlinkedsrvlogin in BOL. Alternatively look at the Security tab and then Linked Servers in Enterprise manager.

Once the servers are linked you SQL statement needs to be fully qualified like this:

Select * from Servername.Databasename.Owner.Tablename

Rick.
 
bravo, I took me awhile to stumble through creating a Linked Server. But I did it.

how 'bout a star DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top