CiccioMiami
CiccioMiami

Reputation: 8256

Is there any special code to store a Carriage Return in a SQL Server database field?

I need to store (hardcoded) a carriage return in a database field. I just find methods to do it with programming languages (for instance char(13) in TSQL) but I just want to write it BY MYSELF in a field, as it happens in HTML with &quot, &nsbp, etc...

Thanks

Francesco

Upvotes: 1

Views: 490

Answers (2)

Dalex
Dalex

Reputation: 3625

SET @SomeVar="Hello 
     World".
All what do you need to write CR by hand it is just to press Enter inside of string.

Upvotes: 1

gbn
gbn

Reputation: 432271

Raw SQL:

INSERT MyTable (col1, col2)
VALUES (1, '
')

There is no way in SSMS, Edit table mode.

Upvotes: 1

Related Questions