SQL Server describing first result set fails when temp table is used (sp_describe_first_result_set)
问题 Long story short, I have a third-party application which behaves differently when it cannot retrieve the metadata of the query/stored procedure. It is known, that sys.sp_describe_first_result_set fails to retrieve the metadata for a stored procedure when a temp table is used in it. For the sake of simplicity, here is a simple example. CREATE PROCEDURE dbo.Test @Seed INT = 0 AS BEGIN CREATE TABLE #MyTemp ( ID INT NOT NULL ); INSERT INTO #MyTemp (ID) VALUES (@Seed + 1) , (@Seed + 2) , (@Seed +