Skip to main content
Inspiring
August 25, 2006
Question

SQL: sp_addlinkedserver? (Querying two DBs)

  • August 25, 2006
  • 1 reply
  • 522 views
I'm full of SQL questions today.

I'm trying to do a join across two servers in Enterprise Manager for MS SQL.
Can this be done?

Here is my query:

SELECT *
FROM WeSiteMenus INNER JOIN
SQLPRODSERV.DBPublic.dbo.WeSiteMenus WeSiteMenus_1 ON
WeSiteMenus_1.pageID = WeSiteMenus.pageID

And here is the error I get in Enterprise Manager:

---------------------------
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find server
'SQLPRODSERV' in sysservers. Execute sp_addlinkedserver to add the server to
sysservers.
---------------------------

Is something wrong with my syntax, or do I need to so something with that
stored procedure. I've ran it, but it doesn't seem to fix anything.

-Darrel


This topic has been closed for replies.

1 reply

Inspiring
August 25, 2006
The other server needs to be set up as a linked server. Note that the other
server will have to have yours set up as a linked server as well. That link
would have to be configured to allow remote access, etc, etc, there's a lot
to consider.

It would probably be best if you read the details in the BOL.



"darrel" <notreal@nowhere.com> wrote in message
news:ecncnu$1a6$1@forums.macromedia.com...
> I'm full of SQL questions today.
>
> I'm trying to do a join across two servers in Enterprise Manager for MS
> SQL. Can this be done?
>
> Here is my query:
>
> SELECT *
> FROM WeSiteMenus INNER JOIN
> SQLPRODSERV.DBPublic.dbo.WeSiteMenus WeSiteMenus_1 ON
> WeSiteMenus_1.pageID = WeSiteMenus.pageID
>
> And here is the error I get in Enterprise Manager:
>
> ---------------------------
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find server
> 'SQLPRODSERV' in sysservers. Execute sp_addlinkedserver to add the server
> to sysservers.
> ---------------------------
>
> Is something wrong with my syntax, or do I need to so something with that
> stored procedure. I've ran it, but it doesn't seem to fix anything.
>
> -Darrel
>