Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


How to add a carriage return in SQL VarChar field

Posted on 2005-03-15
Medium Priority
Last Modified: 2008-01-09
I have a stored procedure:

Declare @address as varchar(250)

set @address = @address + 'Address Line 1' + char(13)  --char 13 being the code for a Return character
set @address = @address + 'Address Line 2' + char(13)

When I insert this variable into a varchar field in a SQL table and then generate a report using MS Access from it  I just get little squares where the new lines should be.

Is there an equivalant in SQL to the VBA "vbcrlf"?
Question by:pauldonson

Accepted Solution

jchopde earned 500 total points
ID: 13546501
char(13) + char(10) is CR/LF

Author Comment

ID: 13546777
Fantastic! Thanks for the quick response

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question