Create SP on linked servers

  • I'm using a central master SQL server to maintain other sql servers.

    Is it possible to create a stored procedure that, if executed, create a stored procedure on a remote server?

    This question is because I want to collect information gathered with "@@version" wich is not remotely executable i think.

  • How about select * from openquery(TSTSQL01, 'select @@version'), TSTSQL01 is your linked server.

  • I think this is not a best pratice to do this.

    Try to concentrate all procedures in one server and create linked servers for call this procedures and retrieve youe results to you multi-server.

    Hildevan O Bezerra


    Hildevan O Bezerra

  • The use of 'openquery' is a way that works for what I won't to do. It's hard to change the scripts that way but it seems to work.

    The solution that Hildevan offers is not verry clear for me. What I need is one central point to maintain/interrogate all our SQL servers. Meaning is that all scripts, procedures, etc are stored on the central maint server. Also the results had to come there.

  • OK. Let´s me explain what I do here.

    Create procedure in master server.

    Create linked server for each server of my sql farm.

    Execute an procedure fromn master server passing parameters for output.

    In you case , for use @@version, you can use a dynamic sql statment to obtain a result set.

     

    If you cannot understand, please, let´s explain for me what your procedure do for I help you better.

     

    Tks

     

     

     


    Hildevan O Bezerra

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply