Link to home
Start Free TrialLog in
Avatar of Bharat Guru
Bharat Guru

asked on

How to generate insert script from sql server with line breaks in data

I have data with line feeds as below how can I generate the insert scripts with line break

Mytable
----------
Field1                      Desc
1                              This is a tes1a<CR>
                                This is a tes1b<CR>
                                This is a tes1
2                              This is a tes2a<CR>
                                This is a tes2b
3                              This is a tes3a<CR>
                                This is a tes3b<CR>
                                This is a tes3c
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Carriage Return = CHAR(13)
Line Feed = CHAR(10)

Typically the LF char is more critical, but if you just want a CR you can do this:

'This is a tes1a' + CHAR(13) + 'This is a tes1b' + CHAR(13) + 'This is a tes1'
Bharat, do you still need help with this question?
Avatar of Bharat Guru
Bharat Guru

ASKER

Thanks