Avoid waiting for a return from server | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Avoid waiting for a return from server

I work whith special programs requiring some kind of real time performance.
They are the source for data inserted into databases. The inserts are no problem. Quite fast and small transactions. On the other hand the programs are also the source of event-trigers that cause some heavier work in the database. The execution is today usually done with SP when scheduled jobs can’t be used.
Is there a way where I can issue a command (with paramteres) and get a transaction of some kind done on the SQL-server without waiting for the transaction to complete?
To me it is more important to get on with other tasks than knowing the result of the command. That could be checked later in a custom transaction log.

Depends on the interface your using. When using ADO, you can specify asynchronous operation. Not sure if you can still monitor the status of that operation from the client app.
quote:Originally posted by Adriaan Depends on the interface your using. When using ADO, you can specify asynchronous operation. Not sure if you can still monitor the status of that operation from the client app.

Ok, interesting. In one of the programs use the .net library. It’s running in a specified cyclus and although it has it’s own asyncronus option this is only true as log as the whole script completes within the specified cyclus time. If the ADO Asynchronous option will let the script continue that would be helpful. Anyone using this option? The other program has an event based script engine but have limited SQL support. It uses an OleDB connection but can basically only send T-SQL code through that connection.
For run and forget, use either asynchronous operation of the ADO (beginexecute…) or use threading. Eitherway, it lets you continue running other codes of application without waiting for completion. threading can monitor/capture the errors using try/catch. Hope this helps.
]]>