Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2007
    Posts
    4

    Unanswered: Calling an executable file from stored procedure

    Hi people.

    I have this issue

    I'm on a application server and i need to run a executable file from a SP, my problem is if i use xp_cmdshell (from the SP) it will try to run it on the SQL Server not on a App server, this a third party executable so cannnot be run on the sql backend.

    Do you know any workaround for this?

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    have the client launch it on it's own.

    what business does the server have launching apps on the client anyway?

  3. #3
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    jez,

    you never call a report engine or a command line DOS thingie from you application code?
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by RazorMX
    Hi people.

    I have this issue

    I'm on a application server and i need to run a executable file from a SP, my problem is if i use xp_cmdshell (from the SP) it will try to run it on the SQL Server not on a App server, this a third party executable so cannnot be run on the sql backend.

    Do you know any workaround for this?

    Is this executable a GUI? If so, don't do it...it could hose everything

    If it's just like a bat file, or a batch process then you should be fine
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    Jul 2007
    Posts
    4
    Actually is a exe file with some parameters (not GUI)

    Picture this

    Server A
    Application Server

    Server B
    SQL Server 2005


    on Server A, i'm executing a SP wich is located on Server B if i use xp_cmdshell is going to look on server B but the exe file is located on server A... can i do like a Remote Execution?

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Why wouldn't you place the executable on both servers?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  7. #7
    Join Date
    Jul 2007
    Posts
    4
    won't work the executable on the SQL Server by itself, i need to install the whole application and we don't have the license for it.

  8. #8
    Join Date
    Feb 2004
    Location
    Burbank & Santa Cruz de la Sierra
    Posts
    3,716
    Can't your xp_cmdshell just include the complete path to the executable?

    as in
    Code:
    xp_cmdshell '\\MyRemoteServer\MysteryJob\DoSomething.bat'
    works fine where I live.

    Worst case you could have your bat file start the exe. We do some of that, though it's too close to 5:30 on Friday for me to make a decent effort at finding the applicable code at this time.
    aka "Paul"
    Non est ei similis.

    I just read "100 Things To Do Before You Die". I was surprised that "Yell for help!!" wasn't one of them

  9. #9
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    Quote Originally Posted by Thrasymachus
    jez,

    you never call a report engine or a command line DOS thingie from you application code?
    sure, but that's not how I read the question.

    how I read it was, "how do I launch an exe that lives on the client from a stored procedure on the server?"

    perhaps I misinterpreted.

Posting Permissions

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