External Application Calls

External Application Calls

Post by m » Fri, 28 Jun 2002 02:50:56



How can I call an executable from a Transact-SQL
procedure.  ie. Notepad.exe.  Is there a command line
mode?
 
 
 

External Application Calls

Post by Anith Se » Fri, 28 Jun 2002 02:56:54


You can use EXEC master..xp_cmdShell 'command' to execute
normal command line executables.

EXEC master..xp_cmdShell 'DIR C:'

However executables with interfaces (graphical or interactive)
will spawn new threads which are not handled by SQL Server. Thus
you find the executables "hanging" if you run them using
master..xp_cmdshell. Notepad.exe  falls in this case.

You can find documentation of xp_cmdshell in SQL Server Books
Online and on Technet/MSDN websites of Microsoft.

- Anith


Quote:> How can I call an executable from a Transact-SQL
> procedure.  ie. Notepad.exe.  Is there a command line
> mode?


 
 
 

External Application Calls

Post by Andrew Swanso » Fri, 28 Jun 2002 10:31:19


If you need to read the contents of a text file, use type xp_cmdshell
xxx.exe
Probably anything that requires a windows handle, wont run..

Hope this helps..

Andrew

--
Andrew Swanson
CTI Development
"More than just stinkin screen pops!"
Wachovia

Quote:> How can I call an executable from a Transact-SQL
> procedure.  ie. Notepad.exe.  Is there a command line
> mode?

 
 
 

1. HELP: Trigger calling external application

G'Day,

I need to call an external application from an Oracle Trigger.  I have read
the on-line help, but still have questions.

Basically what I need to be able to do is to have an Oracle Trigger (Oracle
8i, I think 8.1.5, running on a DEC Alpha) to be able to call a Visual Basic
application running on NT.  I don't mind having to write a middle app (in C
or JAVA) to call the VB application.

Question 1.
Is it possible to create this call?  Preferably in 1 step.  Will I need to
write a middle app?

Question 2.
Does the Oracle Trigger need to wait for the application to return before
continuing, I would prefer the trigger to continue regardless of what the
application is currently doing.

I'm assuming that since oracle can call, on some OS's, an external C program
at worst I will have to have the trigger call a C program located on the DEC
Alpha, then have the C program call the VB application on NT.

Any advice greatly appreciated
Jeff.

2. fixed width - dynamically set column widths

3. After-Insert-Trigger must call external application

4. pg_dump & Win 9X/NT

5. Business Objects WEBI report called from external application

6. VFP5 and WordPerfect DDE

7. Calling an external application from a trigger

8. Application Role, How to call sp_setapprole in a client Access application

9. DTS and external DLL calls

10. Call external files

11. Calling External Windows Executables