sql 打印超长字符串

ALTER PROCEDURE [dbo].[printf]
(
	@s  nvarchar(max)
)
as
begin
    DECLARE @count INT
    DECLARE @toCount INT

    SET @count = 0
    SET @toCount = (LEN(@s) / 4000) + 1
    WHILE @count < @toCount 
    BEGIN
        PRINT SUBSTRING(@s, (@count * 4000) + 1, 4000)
        SET @count = @count + 1
    END
end

猜你喜欢

转载自blog.csdn.net/qq_32109957/article/details/98870742