(m.ramana@gmail.com) writes:
[quoted text, click to view] > Thanks for taking your time and effort replying to my question.Looks
> like its working, I can see the results in query analyzer but with one
> error
> Server: Msg 15028, Level 16, State 1, Procedure sp_addlinkedserver,
> The server 'PRODUCTION' already exists. (How can I get rid of this????)
>
> Is it because PRODUCTION is already registered in my enterprise manager
> or is it because PRODUCTION is not removed (sp_droplinkedserver or
> something like that) in stored procedure?
Depends on what you mean with "registered in Enterprise Manager". If
you mean a server listed directly under a server group in the tree,
no this has nothing to do with linked servers. The registered servers
are stored in the local registry, out of reach for SQL Server itself.
On other hand if you mean that you had previously registered PRODUCTION
as a linked server from Enterprise Manager, your understanding is right.
In fact, all the management GUI:s in Enterprise Manager are basically
only wrappers on SQL commands and system procedures. So, in fact if
you want to do what EM does, but from code, you can use the Profiler
to eavesdrop on what Enterprise Manager emits.
I don't remember for sure, but I believe that the command to drop a
linked server is sp_dropserver. The topic for sp_addlinkedserver in
Books Online should have a See Also to that topic.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at