Access to Result sets from within Stored procedures Transact-SQL SQL Server

前端 未结 7 1175
栀梦
栀梦 2020-11-27 17:59

I\'m using SQL Server 2005, and I would like to know how to access different result sets from within transact-sql. The following stored procedure returns two result sets, ho

7条回答
  •  -上瘾入骨i
    2020-11-27 18:24

    Sadly it is impossible to do this. The problem is, of course, that there is no SQL Syntax to allow it. It happens 'beneath the hood' of course, but you can't get at these other results in TSQL, only from the application via ODBC or whatever.

    There is a way round it, as with most things. The trick is to use ole automation in TSQL to create an ADODB object which opens each resultset in turn and write the results to the tables you nominate (or do whatever you want with the resultsets). you can also do it in DMO if you enjoy pain.

提交回复
热议问题