Results 1 to 4 of 4

Thread: linked server

  1. #1
    Join Date
    Mar 2004
    Posts
    3

    Unanswered: linked server

    I have a programm that create linked server on start of application and delete it on finish.
    I need to check if linked server already exist on my server.
    How can i do it?

  2. #2
    Join Date
    Feb 2004
    Location
    PAKISTAN
    Posts
    106
    system catalog: SYSSERVERS

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The easy way would be to check the return code from sp_addlinkedserver.

    -PatP

  4. #4
    Join Date
    Feb 2004
    Posts
    8
    Hi gorodd,

    Assuming you have a server called "goroddServer"

    if exists (select srvname from master.dbo.sysservers where srvname = goroddServer)
    begin
    print 'goroddServer already exists and is dropped'
    exec sp_dropserver goroddServer
    end

    You may not want the print statement but I have it in for debugging purposes

    Hope this helps

    Richard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •