Asynchronous execution

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
AntonPlotnikov
Posts: 1
Joined: Thu 28 May 2015 07:38

Asynchronous execution

Post by AntonPlotnikov » Thu 28 May 2015 07:45

Hello.

How can I run a long running stored procedure in asynchronous mode? In addition I want receive SQL Server prints during batch execution. I tried to use NonBlocking option of TMSQuery but execution was synchronous anyway

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Asynchronous execution

Post by azyk » Tue 02 Jun 2015 12:36

To execute a stored procedure in the asynchronous mode, use the TMSSQL component. Before calling the TMSSQL.Execute method, set the TMSSQL.NonBlocking property to True.

To retrieve SQL Server info messages in SDAC, you can use the TMSConnection.OnInfoMessage event handler. This event will be generated when executing a query with TMSQuery, TMSStoredProc. Refer our online documentation for more details about this event: https://www.devart.com/sdac/docs/#devar ... essage.htm

To learn how to implement asynchronous transfer of SQL Server info messages, read the MSDN blog: https://social.msdn.microsoft.com/Forum ... -displayed

Post Reply