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.
Asked
Active
Viewed 1.9k times
3 Answers
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
-
May i know how to select it as multiple rows – Sam1604 Jun 28 '14 at 06:40
-
Best to post a new question. – Alex K. Jun 28 '14 at 09:03
1
You can use REPLACE('Line1@Line2@Line3', '@', CHAR(13) + CHAR(10))
, for example.

User
- 3,244
- 8
- 27
- 48