I need to find the column definitions from a stored procedure.The docs for sp_describe_first_result_set
show an entry for user_type_name
where I'd expect to see my User Defined Types. Sadly, data for UDTs seems to be missing from the procedure result. Given the sample code:
CREATE PROCEDURE [dbo].[test]
AS
BEGIN
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
DECLARE @test TABLE (
a BIGINT
,b udtTest
,c NVARCHAR(100)
,d BIT
)
INSERT INTO @test (
a, b, c, d
) VALUES (
1, 'udtTest', 'nvarchar', 0
)
select *
from @test
END
GO
EXEC [dbo].[sp_describe_first_result_set] @tsql = N'test';
GO
I'm seeing the following (db<>fiddle):
name | system_type_name | user_type_name |
---|---|---|
a | bigint | NULL |
b | nvarchar(123) | NULL |
c | nvarchar(100) | NULL |
d | bit | NULL |
Why is udtTest
missing from my data for column name b
?