Y
Y
yar2292013-11-25 21:57:34
SQL Server
yar229, 2013-11-25 21:57:34

How to get structure of all resultsets from stored procedure?

(MS SQL Server 2012)
This is how we can get the structure of the first (single) data set.

CREATE PROCEDURE dbo._tmp_ResSet
AS BEGIN
  SELECT 1 AS Num;
  SELECT 2 AS Num, 'two' AS NumStr;
END
GO
 
DECLARE @sql NVARCHAR(MAX) = N'EXEC _tmp_ResSet'; 
SELECT	*
FROM	sys.dm_exec_describe_first_result_set(@sql, NULL, 1) c
WHERE	c.is_hidden = 0;

Whether there is an opportunity to receive structure of all sets, using only possibilities MSSQL?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question