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 2000 Forums
 SQL Server Development (2000)
 Get from 2 SQL Server Groups?

Author  Topic 

quickstep25
Starting Member

4 Posts

Posted - 2004-06-09 : 14:11:49

Briefing: On the project I'm involved with, there are two SQL server groups (SUN and MOON). They both have an identical database (STARS). Inside the databases there are identical tables called PLANET. So the only difference is the two sql server groups.

Question: I have to write a script that will select certain records in SUN (server group) and insert those records into MOON (server group. If I am not connected to SUN server group in query analyzer by this statement:
SELECT [DISTANCE]
FROM [SUN].[STARS].[dbo].[PLANET]
WHERE distance > 10
--- I get this error:Server: Msg 7202, Level 11, State 2, Line 1
Could not find server 'SUN' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.

How can I select data from another server group? Granted, if it is possible.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-06-09 : 14:14:15
What do you mean by SQL Server groups? Is SUN a server?

Tara
Go to Top of Page

acollins74
Yak Posting Veteran

82 Posts

Posted - 2004-06-09 : 14:15:01
holy hw assignment.
you should look up sp_addlinkedserver in BOL.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-06-09 : 14:25:43
Can you paste the assignment? Or is it in a book? If so what book...



Brett

8-)
Go to Top of Page

quickstep25
Starting Member

4 Posts

Posted - 2004-06-09 : 14:33:28
Nevermind. Figured it out.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-06-09 : 14:44:16
What was the solution?

Tara
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-06-09 : 15:52:45
And what happens when Venus crosses in front of the SUN Server?



Brett

8-)
Go to Top of Page

quickstep25
Starting Member

4 Posts

Posted - 2004-06-09 : 17:16:15
Well after talking to the DBA, I finally convinced him to load the "mirror" database onto the SAME server. Then we could move mass amounts of data like so:
INSERT INTO [SUN].[dbo].[PLANET]
SELECT *
FROM [MOON].[dbo].[PLANET]

Once you convince the people that hired you, that you might have a better solution.... it's all easy.

Just trying to get through the day without making too many enemies. Cheers!
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-06-09 : 22:57:10
Who do you work for. Sounds like an interesting database. :)

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

quickstep25
Starting Member

4 Posts

Posted - 2004-06-10 : 08:28:23
It might scare you to know that I am subcontracting for NASA. The DBA on this project, to my knowledge, came straight off the "web design" wagon. Wheeeeeeeeeeeee.

People in power are usually idiots. Its the 10 million dollar question.
Go to Top of Page
   

- Advertisement -