Click here to Skip to main content
Rate this: bad
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 )
	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
i am using this line of code.and it display my error message like this
but i want to display my error message like this
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
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' 
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
Your Filters
0 Shai Vashdi 1,518
1 Tadit Dash 350
2 Manas Bhardwaj 319
3 OriginalGriff 243
4 Sergey Alexandrovich Kryukov 205
0 Sergey Alexandrovich Kryukov 9,530
1 OriginalGriff 5,716
2 Peter Leow 4,320
3 Maciej Los 3,540
4 Abhinav S 3,373

Advertise | Privacy | Mobile
Web01 | 2.8.140415.2 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid