View string content

zhaozj2021-02-16  89

When debugging the stored procedure, how to display more than 255 characters? Because whether it is print or SELECT is not convenient

The best way is of course writing a stored procedure to show it.

Create procedure sp_getstr @str varchar (4000)

/ **********

Modify: qiubele

Remarks: Read the content in the string

********** / as declare @i int set @i = 0 loop1: select substring (@str, @i * 255, (@i 1) * 255) set @i = @i 1 if len (@str)> @i * 255 goto loop1

转载请注明原文地址:https://www.9cbs.com/read-11389.html

New Post(0)