Search code examples
debuggingstored-proceduresssmsvisual-studio-debuggingssms-2012

In SSMS SP debugger, can "Watch" variable value length be increased above 255 character limit


I need to monitor (in Local or in Watch) a varchar(max) field where the value length is approximately 500 characters. But when I try to view or copy/paste the value, only the first 255 characters are there. How can I change this limit so I can view the entire value instead of only part of it?enter image description here I even tried debugging in VS2019, but I still experience this same value length limit. (I can use either VS or SSMS 2012).


Solution

  • If you want to view the entire length of the varchar(max) Watch/local variable, you can also right click the value and select Copy Value (not Copy) and paste them into notepad file. You will see the entire length of your variable. enter image description here But i think the best way to view the entire length of the variable is to use view icon to view them in different formats.

    UPDATE

    If you want to use SSMS2012 only for debugging SPs, i suggest you to debug it in Visual Studio instead.

    Right click your database projcet->Add->Stored Procedure

    Press the drop-down arrow on the green arrow button in the Transact-SQL editor toolbar and select Execute with Debugger to execute the query with debugging on. enter image description here

    For more information, please refer to :

    https://learn.microsoft.com/en-us/sql/ssdt/how-to-debug-stored-procedures?view=sql-server-ver15#to-debug-stored-procedures