How to see the values of a table variable at debug time in T-SQL?

前端 未结 10 1984
悲哀的现实
悲哀的现实 2020-11-29 15:30

Can we see the values (rows and cells) in a table valued variable in SQL Server Management Studio (SSMS) during debug time? If yes, how?

10条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 16:33

    If you are using SQL Server 2016 or newer, you can also select it as JSON result and display it in JSON Visualizer, it's much easier to read it than in XML and allows you to filter results.

    DECLARE @v nvarchar(max) = (SELECT * FROM Suppliers FOR JSON AUTO)
    

提交回复
热议问题