mmathias
mmathias

Reputation: 3

List columns from a stored procedure in SQL Server 2008

Does anyone know if there´s any alternative to the function sys.dm_exec_describe_first_result_set_for_object to retrieve a list of columns from a stored procedure in SQL Server 2008.

The function sys.dm_exec_describe_first_result_set_for_object only works after SQL Server 2012, but I need to complaint with SQL Server 2008.

I already studied the dependencies schema, but it does not bring exactly the same columns because dependencies are linked with the tables. It didn't solve my question.

OPENQUERY is not an alternative in my production environment as well (for security reasons).

Upvotes: 0

Views: 161

Answers (1)

David Browne - Microsoft
David Browne - Microsoft

Reputation: 89051

The older method is FMTONLY processing.

eg

set fmtonly on
exec SomeProc
set fmtonly off

Which will return an empty resultset for each static SQL query that returns results in the stored procedure. And does not actually perform any data access or run any DML statements.

Upvotes: 1

Related Questions