sql server 2008 - MS SQL Backslash preceding new line/line feed removes line break -
i'm working in classical asp , trying insert user input ms sql 2008 database. every day, don't think i've ever experienced bug before.
the bug getting that, if user ends line of text in backslash, , starts new line below, both backslash , line break lost after data stored in db.
if try following statement, hardcoded asp file:
update tblarticle_text set introduction = 'text on first line \" & vbcrlf & " text on second line' articleguid = 28 the resulting data without backslash or line break. string correct if stored in variable , printed on page.
here example user input (normally form, it's not relevant). input:
text on first line \ text on second line ... stored as:
text on first line text on second line i don't see issues if backslash followed other line break.
i know old, came across ms kb article discusses this: http://support.microsoft.com/kb/164291/en-us. long , short of 3 characters \<cr><lf> weird escape sequence, , need replace occurrences of \<cr><lf> \\<cr><lf><cr><lf> when inserting or updating because first backslash in \\<cr><lf><cr><lf> escapes weird escape sequence, i.e. next 3 characters \<cr><lf>, , additional <cr><lf> puts carriage return in place. annoying, yes.
Comments
Post a Comment