Call Exe from Stored Procedure

  • Hi Guys,

    We are using MSSQL Server 2000 and Sybase PowerBuilder. I need to know if it is possible to call a Powerbuilder exe through a SQL Server Stored procedure.

    I would appreciate your help.

    Thanks

  • provided the app doesn't need any user intervention and message boxes etc can be suppressed then you can call an executable from SQL stored proc by using xp_cmdshell to shell out to the OS. It's crude but it works.

    HTH

    thanks

    SQL_EXPAT

  • Is it possible to get an example.

    Thanks

  • exec xp_cmdshell 'dir c:\'

  • Yasir, why do you want to call power builder from a stored proc?if you dont mind you can tell us your problem and then we can try to suggest a better (if any) soln.


    Everything you can imagine is real.

  • You could also (shudder) create a COM object for your powerbuilder code and use the sp_OAxxx procedures in MS SQL to call your code. It depends if you want to pass parameters around the place or if you're happy building a command line (with any parameters appropriately escaped) and then parsing the recordset from xp_cmdshell...

  • We are a PowerBuilder & SQL Server shop. We have a sister company that develops for handhelds.

    I have to develop this procedure for them. They will call this procedure and then I will call a PB exe already in use.

    Hope this helps.

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

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