?
Solved

How to add a carriage return in SQL VarChar field

Posted on 2005-03-15
2
Medium Priority
?
3,254 Views
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)
...etc

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"?
0
Comment
Question by:pauldonson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

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

Author Comment

by:pauldonson
ID: 13546777
Fantastic! Thanks for the quick response
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

777 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