running external apps from sql server 2000?

  • Is there a way of running external apps from server 2000? Possibly using xp_cmdshell???


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • Hi achowe,

    quote:


    Is there a way of running external apps from server 2000? Possibly using xp_cmdshell???


    you're on the right track.

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • can you specify a command line/address after xp_cmdshell? i.e. xp_cmdshell 'c:/.........'?

    Cheers!


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • Hi achowe,

    quote:


    can you specify a command line/address after xp_cmdshell? i.e. xp_cmdshell 'c:/.........'?


    yes, you can do something like xp_cmdshell 'dir *.exe'.

    Take a look at BOL for xp_cmdshell. there are several examples of usage

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Ive executed the following:

    EXEC master..xp_cmdshell 'c:\pcplus\refiner.exe'

    ..but it seems to lock up query analyser...can u see an immediate problem with the command above?

    Thanks


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • Hi achowe

    quote:


    EXEC master..xp_cmdshell 'c:\pcplus\refiner.exe'

    ..but it seems to lock up query analyser...can u see an immediate problem with the command above?


    looks correct.

    Is this refiner.exe on the SQL Server or on your Workstation? Unless I am mistaken, xp_cmdshell tries to execute your command on your Server.

    When you type C:\\...\refiner.exe the C:\ drive of your server is scanned, not that of your workstation.

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • I think your right actually...any ideas how to get around this? refiner.exe is on my workstation.........


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • Please check your permission rights first for the crashing problem.

    Another way to call the external application is through COM object. COM object will do what needed to be done. And TSQL communicate COM object only.

    Look under sp_OACreate in MSDN.

  • Not too sure I understand what you mean..could you expand?

    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • Is 'refiner.exe' expecting user input? If so it may wait indefinately (and so hang Query Analyser). Run the command from the Command Prompt on the server and see what happens.

    If refiner can take options on the command line then make sure that you complete all that are required. Alternatively you may need to launch it client side.

  • It is expecting user input at specific stages..will try this and post back with the result! Cheers

    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • I've made a copy of refiner.exe on the server and run the command from the server but get an error message 'Access Denied', although I thought I had administrator access

    rights.......could this error mean something else???

    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • Is this a command prompt error or a ‘refiner’ error? Also NT Administrators can be denied access to files and folders - but they can just reset the permissions to allow themselves access again. Ensure that you have permissions on the file, and any folder in which it is creating temp files.

    Is ‘refiner’ accessing data elsewhere? If so you may need access to that location too.

    And remember that xp_cmdshell doesn't run using your NT account – for sysadmins it uses the SQL Server service account’s context and for other users it will impersonate the SQL Server Agent proxy account (for SQL Server 2000).

    See Books Online’s section on xp_cmdshell for more details.

  • Refiner is accessing data on the server..is there an alternative to xp_cmdshell?

    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!


    If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!

  • It depends on why and when you wish to run the command, and what it does.

    If you are calling the exe in response to a client action then consider running the command at the client. In VB you can use the Shell command to do this but most languages have a mechanism to run system commands...

Viewing 15 posts - 1 through 14 (of 14 total)

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