Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mary_itohan
Posting Yak Master
191 Posts |
Posted - 2008-09-07 : 06:40:23
|
Hello,am trying to run an if statement. How do i validate 3 expressions. Here is my codeAll variables below are integers.the expression left(@each_recipient,@len_countrycode)the value of @len_countrycode is an integer that is evaluated at runtime.if ((@length = @defaultlength) and (isnumeric(@each_recipient)) and (left(@each_recipient,@len_countrycode) = @defaultcountry )) thanksI get this error when i run itMsg 4145, Level 15, State 1, Procedure Cellulant_SendSMS_billing, Line 71An expression of non-boolean type specified in a context where a condition is expected, near 'and'.Yes O ! |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2008-09-07 : 06:52:36
|
tryif ((@length = @defaultlength) and (isnumeric(@each_recipient)=1) and (left(@each_recipient,@len_countrycode) = @defaultcountry )) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-07 : 07:28:30
|
| Also keep in mind that isnumeric is not fully reliable. refer the below for more details:-http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/enhanced-isnumeric-function.aspx |
 |
|
|
|
|
|