Passing data from stored procedure to windows applicaton
-
Hi, I have an application A which runs a stored procedure. I want that stored procedure to get and send data to another application B. What can be the efficient ways, currently we are using temporary table and using pooling on that table by application B.
Regards Shajeel
-
Hi, I have an application A which runs a stored procedure. I want that stored procedure to get and send data to another application B. What can be the efficient ways, currently we are using temporary table and using pooling on that table by application B.
Regards Shajeel
SQL Server doesn't offer any support for that. If you want to pass messages between applications, and have them persist in the case of software or hardware failure, Microsoft's solution is Microsoft Message Queueing[^]. The temporary table is one solution, but do remember that true temporary tables (named with a
#
or##
prefix) are stored intempdb
, which is not persisted across SQL Server runs. It is recreated from scratch every time SQL Server starts up. I believe it is also recreated whenever a SQL Server cluster fails over to a different node, though I'm not sure about that. SQL Server 2005 and .NET Framework 2.0 offer theSqlDependency
class, which can be used to send a query to the database and the database to then call the application back when the results of that query would change. For more information, look up "query notifications" in the index in Books Online.
DoEvents
: Generating unexpected recursion since 1991 -
SQL Server doesn't offer any support for that. If you want to pass messages between applications, and have them persist in the case of software or hardware failure, Microsoft's solution is Microsoft Message Queueing[^]. The temporary table is one solution, but do remember that true temporary tables (named with a
#
or##
prefix) are stored intempdb
, which is not persisted across SQL Server runs. It is recreated from scratch every time SQL Server starts up. I believe it is also recreated whenever a SQL Server cluster fails over to a different node, though I'm not sure about that. SQL Server 2005 and .NET Framework 2.0 offer theSqlDependency
class, which can be used to send a query to the database and the database to then call the application back when the results of that query would change. For more information, look up "query notifications" in the index in Books Online.
DoEvents
: Generating unexpected recursion since 1991Thanks for the reply. We are actually using Oracle and VC 6 services and table is not actually temporary, it is simple table but data in it is only stored for message passing and then removed. I just wanted to know whether there is any better solution but it seems like our solution is the best we can get as we cannot modify first application.
Regards Shajeel