Does anyone know if it is possible to use the Visual Studio / SQL Server Management Studio debugger to inspect the contents of a Table Value Parameter passed to a stored procedure?
To give a trivial example:
CREATE TYPE [dbo].[ControllerId] AS TABLE(
[id] [nvarchar](max) NOT NULL
)
GO
CREATE PROCEDURE [dbo].[test]
@controllerData [dbo].[ControllerId] READONLY
AS
BEGIN
SELECT COUNT(*) FROM @controllerData;
END
DECLARE @SampleData as [dbo].[ControllerId];
INSERT INTO @SampleData ([id]) VALUES ('test'), ('test2');
exec [dbo].[test] @SampleData;
Using the above with a break point on the exec statement, I am able to step into the stored procedure without any trouble. The debugger shows that the @controllerData local has a value of '(table)' but I have not found any tool that would allow me to actual view the rows that make up that table.