xp_cmdshell

  • Good Day,

    I want to ask how to troubleshoot this kind of problem. I'm handling many servers everyday (select, update, delete). I created a script to run any sql commands thru linkservers but i noticed 1 server not returning any rows. the command i used is exec master..xp_cmdshell 'echo test' all other servers except this server is returning the word test I also test the script in the server itself but to no avail. How can i resolve the situation? thanks...

    "-=Still Learning=-"

    Lester Policarpio

  • What do you mean "no avai"? Did you check whether or not this extended stored procedure exists?

  • Try running the command directly on the server once

  • Lester Policarpio (7/21/2008)


    Good Day,

    I want to ask how to troubleshoot this kind of problem. I'm handling many servers everyday (select, update, delete). I created a script to run any sql commands thru linkservers but i noticed 1 server not returning any rows. the command i used is exec master..xp_cmdshell 'echo test' all other servers except this server is returning the word test I also test the script in the server itself but to no avail. How can i resolve the situation? thanks...

    What is the default output device for that particular printer? It sounds like it might NOT be "CON" (console).

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thanks for the replies guys

    @SQL ORACLE - Yes, xp_cmdshell exists in that server. I'm also using the sa account

    @dev - I tried both (execute using linked server and directly on the server) both using QA

    @jeff Moden - ? sorry for being so noob. every command i execute which includes xp_cmdshell (in this particular server) didn't return anything even a simple "DIR" but for the other servers it works perfectly. Do i need to tweak something here?

    * All using Query Analyzers

    Again thanks for your time...

    "-=Still Learning=-"

    Lester Policarpio

  • Ummm... let's do a small test on the "bad" machine... if you open a "Command Prompt" window, type DIR and press {Enter}, does it return anything? And, no, not talking about doing it through xp_CmdShell... I'm talking about clicking on {Start}{Run}, typing in "CMD", and pressing {Enter}

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I think we located the problem...

    When we used a remote server application (since the server is a branch server far from our location) the windows interface is not responding although the server (when executing QA using my own local server) is fine. We cannot restart the server since this is a production db and there where no problems encountered by the branch. I'll give an update once the server has been restarted (after office hours).

    Thanks for the help

    "-=Still Learning=-"

    Lester Policarpio

Viewing 7 posts - 1 through 6 (of 6 total)

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