0

I want to use the following statement to add a row in a table named people with one column which is varchar(100)

insert into people values ('a b')

I want to have a new line between a and b.

How to do this?

I tried something like 'a CHAR(13) b' but did not work.

Thanks.

D.K. Xu
  • 1
  • 1
  • 1
  • 1
  • possible duplicate of [Adding a line break in MySQL INSERT INTO text](http://stackoverflow.com/questions/2902888/adding-a-line-break-in-mysql-insert-into-text) – Eric Petroelje Apr 24 '12 at 17:01

2 Answers2

5

How about

'a ' + CHAR(13) + ' b'
Rahul
  • 76,197
  • 13
  • 71
  • 125
rickythefox
  • 6,601
  • 6
  • 40
  • 62
1

This works as well:

'a' +  CRLF + 'b'

Check this link as well

How to insert a line break in a SQL Server VARCHAR/NVARCHAR string

Community
  • 1
  • 1
Rahul
  • 76,197
  • 13
  • 71
  • 125