Eirikur Eiriksson (8/4/2015)
sgmunson (8/4/2015)
Eirikur Eiriksson (8/4/2015)
sgmunson (8/4/2015)
Eirikur Eiriksson (8/3/2015)
Quick suggestion, use sys.dm_exec_describe_first_result_set or sys.dm_exec_describe_first_result_set_for_object, to get the structure of the output of the stored procedure.😎
According to MS doc, that applies only to SQL 2014 and above, and this post is in a 2008R2 forum... unless it's "undocumented" in the earlier version ?
My bad, the procedure sp_describe_first_result_set was introduced on 2012, along with the the dms. On 2005 and later one can use FMTONLY
😎
Okay, but FMTONLY requires a tool other than SSMS if you want to derive a CREATE TABLE statement from what you get back, which is just an empty recordset. With the dmv, you get a table back that can be used to derive a CREATE TABLE statement, fairly easily.
Not really, just grab the execution plan and read it from there
😎
Not exactly an automatic solution, though.
--Jeff Moden
Change is inevitable... Change for the better is not.