<p>Is there a way when executing a stored procedure in Management Studio to get the data types of the result sets coming back? I'm looking for something like functionality of when you pass a table name to sp_help</p>

[{'answer_id': 33188, 'author': 'Danimal', 'author_id': 2757, 'author_profile': 'https://Stackoverflow.com/users/2757', 'pm_score': 0, 'selected': False, 'text': "<p>No easy way comes to mind without parsing syscomments to see what it's querying from where. If you can edit the SP to select XML, you can append XML_INFO to the query to get the schema back.</p>\n"}, {'answer_id': 33198, 'author': 'Daren Thomas', 'author_id': 2260, 'author_profile': 'https://Stackoverflow.com/users/2260', 'pm_score': 1, 'selected': False, 'text': '<p>You do get to look at the types though, if you call the stored procedure via ADO, ADO.NET, ODBC or the likes: The resulting recordsets have the type information you are looking for. Are you really restricted to Management Studio?</p>\n'}, {'answer_id': 65029, 'author': 'Charles Graham', 'author_id': 7705, 'author_profile': 'https://Stackoverflow.com/users/7705', 'pm_score': -1, 'selected': False, 'text': "<p>You could always use an actual table that is garrenteed to be unique.  It's a kludge, but it's an option.  This will not work inside a stored proc though.</p>\n\n<pre><code>if exists (select * from sys.tables where name = 'tmp_TableName')\n    drop table tmp_TableName\ngo\nselect * into tmp_TableName from MyTable\n\n--do some stuff\n\ngo\nif exists (select * from sys.tables where name = 'tmp_TableName')\n    drop table tmp_TableName\ngo\n</code></pre>\n"}, {'answer_id': 156031, 'author': 'Cade Roux', 'author_id': 18255, 'author_profile': 'https://Stackoverflow.com/users/18255', 'pm_score': 0, 'selected': False, 'text': "<p>Actually, you can do it from within an SP:</p>\n\n<pre><code>EXEC ('if exists (select * from sys.tables where name = ''tmp_TableName'') drop table tmp_TableName')\n\nEXEC ('select * into tmp_TableName from MyTable')\n\n-- Grab the column types from INFORMATION_SCHEMA here\n\nEXEC ('if exists (select * from sys.tables where name = ''tmp_TableName'') drop table tmp_TableName')\n</code></pre>\n\n<p>Although, I think there must be a better way.</p>\n"}, {'answer_id': 156795, 'author': 'Rory', 'author_id': 8479, 'author_profile': 'https://Stackoverflow.com/users/8479', 'pm_score': 0, 'selected': False, 'text': "<p>It's not the most elegant solution, but you could use OPENROWSET to put the stored proc results into a table, then use sp_help to get a description of it.</p>\n\n<p>eg</p>\n\n<pre><code>select * into tmp_Results \nfrom openrowset( 'SQLOLEDB.1'\n               , 'Server=your_server_name;Trusted_Connection=yes;'\n               , 'exec your_stored_proc')\nexec sp_help 'tmp_Results'\ndrop table tmp_Results\n</code></pre>\n"}, {'answer_id': 157449, 'author': 'ScottStonehouse', 'author_id': 2342, 'author_profile': 'https://Stackoverflow.com/users/2342', 'pm_score': 1, 'selected': False, 'text': '<p>Your best bet would be to change the stored procedure to a function.  But that only works if your environment allows it.</p>\n'}]
['https://Stackoverflow.com/questions/33175', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1302/']