• SQLPain (10/7/2015)


    John,

    I have added linked Server S with report server. Can you please give an example of what would be considered as a fully qualified code.

    Also when I write the code in Step 1, what database should I select? (model, master, msdb, etc)

    Fully qualified query:

    SELECT jb.*

    FROM [MyLinkedServer].msdb.dbo.sysjobs jb

    where jb.job_name = 'D26B10DC-96B4-XXXX-XXXX-99CB2085CA01'

    --openquery version:

    SELECT * FROM OPENQUERY([MyLinkedServer],'SELECT * FROM msdb.dbo.sysjobs where job_name = ''D26B10DC-96B4-XXXX-XXXX-99CB2085CA01'' ;')

    --run a remote command

    EXEC ('EXEC msdb.dbo.sp_start_job @job_name = ''D26B10DC-96B4-XXXX-XXXX-99CB2085CA01'' ;') AT [MyLinkedServer]

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!