Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-Server-2008
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 at 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 at 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?
Sergey Alexandrovich Kryukov at 19-Sep-12 3:54am
   
What is a line break, is unfortunately platform-dependent. In Microsoft systems, for example, this is LF CR (13, 10).
--SA
prince_rumeel at 19-Sep-12 4:05am
   
i am using windows 7.and i want to place two line break in my sentences
Legor at 19-Sep-12 4:09am
   
Well not much more i could add ... SET @ErrorMessage = 'Line 1' + CHAR(13)+ CHAR(13)+ 'Line 2'
prince_rumeel at 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
0 CPallini 385
1 BillWoodruff 344
2 George Jonsson 295
3 Sergey Alexandrovich Kryukov 293
4 OriginalGriff 222
0 OriginalGriff 5,095
1 CPallini 4,285
2 Sergey Alexandrovich Kryukov 3,767
3 George Jonsson 2,941
4 Gihan Liyanage 2,386


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2014
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