Re: Executing a dotnet console application from SQL Server 2005/2008



Is the console application perhaps accessing data modified by the statement that fired the trigger? Keep in mind that the application is executing in a different session than the trigger and the modified data is still uncommitted. You will not be able to access the uncommitted data unless you specify a NOLOCK hint (not recommended).

I'm not sure what the app is doing but you might be better to either use a CLR trigger or using Service Broker. It's a good idea to avoid external access from a trigger since this can result in unnecessarily long-running transactions.

--
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"Ariel Andrés Quesada" <ArielAndrsQuesada@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:F7212F1D-8E27-4820-8684-163CB899EBCB@xxxxxxxxxxxxxxxx
Hi, I have a SQL Server 2005 deployment. Besides, I have a c# 2.0 console
application that I want it to execute in a SQL trigger.

I am trying to use xp_cmdshell to execute the console application, but when
I try to execute the code, the sql server management studio stays "running
the query for long time" without generating results.

What I am doing wrong?

The code is
xp_cmdshell "C:\app.exe"

Thanks in advance.

--
Ariel Andrés Quesada
MSc Systems Engineering, MCBMSP CRM 4.0
MCTS: TFS, MOSS 2007,Forefront, Project 2007,
.NET 2.0: Web/Win Apps, SQL Svr 2005
MCSD, MCSE, MCT

.



Relevant Pages

  • Re: Stored procedure/trigger and scripts
    ... Can you run the vbs by calling it directly from SQL Server using xp_cmdshell (without a trigger)? ... If it does work this way I would probably create a job within SQL Server that would call the vbs at a scheduled interval. ... > SQL Server has permissions to execute xp_cmdshell. ...
    (microsoft.public.sqlserver.programming)
  • [NEWS] Multiple Vulnerabilities in Oracle Database (Trigger, Extproc, Wrapped Procedures, PL/SQL Inj
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Multiple vulnerabilities were discovered in the Oracle database server. ... Oracle Trigger Abuse ... written in PL/SQL and execute with the privileges of the definer/owner. ...
    (Securiteam)
  • Re: Stored procedure/trigger and scripts
    ... must have been the trigger that locked up the table. ... SQL Server has permissions to execute xp_cmdshell. ... >> client to change their password they have to call the "Client Relations" ...
    (microsoft.public.sqlserver.programming)
  • Re: Stored procedure/trigger and scripts
    ... I just ran some additional tests and it looks like my trigger is fine. ... SQL Server has permissions to execute xp_cmdshell. ... >> client to change their password they have to call the "Client Relations" ...
    (microsoft.public.sqlserver.programming)
  • Re: Calling an Executable Within a Trigger
    ... I started by utilizing the Trigger ... and will execute the command line. ... and in the context of the account under which SQL Server ... If you write your own OLE objects you can use sp_OAcreate, but again, ...
    (microsoft.public.sqlserver.programming)

Quantcast