14

I have created varchar(MAX) field as memo field. Unfortunately I do not find a way how to add multiline text into such field using MS SQL Server Management Studio. If I use copy/paste of multiline text only first line of multiline test is inserted into varchar(MAX) field.

Tomas
  • 17,551
  • 43
  • 152
  • 257

3 Answers3

21

As you observe, if you paste in multi-line text only the first line is inserted, instead paste the text into an update statement and run that;

update T set fld =
'aaa
sss
ddd'
where ...

(You need to SELECT in results to text mode to observe the lines, in the grid view they appear as double-spaces)

Alex K.
  • 171,639
  • 30
  • 264
  • 288
1

You can use REPLACE('Line1@Line2@Line3', '@', CHAR(13) + CHAR(10)), for example.

User
  • 3,244
  • 8
  • 27
  • 48
0

did you try ALT+ENTER.. this should add a new line

Anantha Sharma
  • 9,920
  • 4
  • 33
  • 35