Click here to Skip to main content
12,356,455 members (64,443 online)
Rate this:
 
Please Sign up or sign in to vote.
Hi friends,
I want to ask about SQL.

IF(@DATEDifferenceID1 <= 90 AND NOT @DATEDifferenceID1 < 0 )
BEGIN
	
	SET @ErrorMessage = ''  ~ Customer Personal Primary ID is expiring in '' + LTRIM(STR(@DATEDifferenceID1)) + '' Day(s). '' + Char(10) + '' Would you like to proceed and save the remittance?''
	SET @ErrorCode = 1001
END

i am using this line of code.and it display my error message like this

line1..............
line2..............

but i want to display my error message like this

line1..............

line2..............

mean to say i want to add an extra breal line..
helpout me please how can i do this in SQL 2008???
Posted 18-Sep-12 21:35pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I think CHAR(13) is the line break.
So for example

SET @ErrorMessage = 'Line 1' + CHAR(13) + 'Line 2' 
  Permalink  
v2
Comments
prince_rumeel 19-Sep-12 3:52am
   
thanks for your reply.

But bro char(10) is for break line.
as per mentioned in my question there is some line of code,there i am using this char(10) there is line break present.
but i need to show two line break in my sentences...

plz help me
Legor 19-Sep-12 3:56am
   
Yes it is platform dependent as Sergey mentioned below. Can't you just add another CHAR(10) for another line break then?
   
What is a line break, is unfortunately platform-dependent. In Microsoft systems, for example, this is LF CR (13, 10).
--SA
prince_rumeel 19-Sep-12 4:05am
   
i am using windows 7.and i want to place two line break in my sentences
Legor 19-Sep-12 4:09am
   
Well not much more i could add ... SET @ErrorMessage = 'Line 1' + CHAR(13)+ CHAR(13)+ 'Line 2'
prince_rumeel 19-Sep-12 4:45am
   
Legor ur solution is working.but i m using char(10)+char(10) in place of char(13)+char(13)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100