Skip to content

Instantly share code, notes, and snippets.

@dhmacher
Created August 9, 2025 18:44
Show Gist options
  • Select an option

  • Save dhmacher/7d8d55e2939ecad9c79fddad4b5f7fb6 to your computer and use it in GitHub Desktop.

Select an option

Save dhmacher/7d8d55e2939ecad9c79fddad4b5f7fb6 to your computer and use it in GitHub Desktop.
Print really large strings
DECLARE @so_much_text nvarchar(max)=.....
SET @so_much_text=REPLACE(@so_much_text, NCHAR(13)+NCHAR(10), NCHAR(10));
WHILE (@so_much_text!=N'') BEGIN;
PRINT LEFT(@so_much_text, CHARINDEX(NCHAR(10), @so_much_text)-1);
SET @so_much_text=SUBSTRING(@so_much_text, CHARINDEX(NCHAR(10), @so_much_text)+1, LEN(@so_much_text));
END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment