Getting line-breaks into text from an Excel data for pasting to a SQL table

Home / Getting line-breaks into text from an Excel data for pasting to a SQL table

In any Excel cell that needs line-breaks, instead of using ALT-ENTER, put a placeholder {NL} in the Excel cell’s text.

Example: 123 Maple St{NL}Apt 2{NL}Sacramento,CA{NL}95818

Paste the Excel data into the SQL table as normal.

Execute this SQL statement to change the placeholders to SQL line-break characters:

update [tablename] set [fieldname] = replace([fieldname],'{NL}',CHAR(13))