preserving \n from SQL Server Management Studio
To deal with the truncation try converting it to XML for processing
DECLARE @S varchar(max)
SELECT @S = ''
SELECT @S = @S + '
' + EventLog FROM BatchProcess
SELECT @S AS [processing-instruction(x)] FOR XML PATH('')
Code modifed from Martin's Smith's answer to https://stackoverflow.com/questions/2759721/how-do-i-view-the-full-content-of-a-text-or-varcharmax-column-in-sql-server-200
This may also solve the line breaks, but if its a big deal try a different editor
- removes all of the NewLines and is just one continous line.
That sounds like the typical crappiness of Notepad. IIRC, in order to actually display line breaks, Notepad needs \r\n
line endings, not just \n
. Try pasting into WordPad or a real editor.