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 |
|
maya_zakry
Constraint Violating Yak Guru
379 Posts |
Posted - 2007-04-16 : 01:36:36
|
hey all, just cant figure out why my raiserror printWrong RoleType for customer lientIDfor :- RAISERROR('Wrong RoleType for customer %ClientID', 16,1, @ClientID)what's with missing C? is % some kind of escape char or something? (im trying to print back the parameter @clientid), or should i just use the print ''~~~Focus on problem, not solution~~~ |
|
|
PeterNeo
Constraint Violating Yak Guru
357 Posts |
Posted - 2007-04-16 : 01:59:11
|
| replave clientid with d, then u can get itDeclare @ClientID intselect @ClientID = 1RAISERROR('Wrong RoleType for customer %d', 16,1, @ClientID)0utput--------Server: Msg 50000, Level 16, State 1, Line 6Wrong RoleType for customer 1 |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-04-16 : 02:45:12
|
| www.sommarskog.se/error-handling-I.htmlMadhivananFailing to plan is Planning to fail |
 |
|
|
maya_zakry
Constraint Violating Yak Guru
379 Posts |
Posted - 2007-04-16 : 04:48:41
|
| hey all, thanks~~~Focus on problem, not solution~~~ |
 |
|
|
maya_zakry
Constraint Violating Yak Guru
379 Posts |
Posted - 2007-04-16 : 05:02:37
|
helo again, what's wrong with this when @Clientid as varchar?declare @clientid1 as varchar(10)set @ClientID1='JABPB'RAISERROR('Client1 : %d', 16,1,@ClientID1)giving me --> Client1 : 399292452 Not Client1 : JABPBtq~~~Focus on problem, not solution~~~ |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-04-16 : 05:04:46
|
| RAISERROR('Client1 : %s', 16,1,@ClientID1)I THINK IT IS TIME YOU ACTUALLY READ ABOUT RAISERROR FUNCTION ON BOOKS ONLINE!Peter LarssonHelsingborg, Sweden |
 |
|
|
maya_zakry
Constraint Violating Yak Guru
379 Posts |
Posted - 2007-04-16 : 07:21:37
|
| :(it is fronm BOL the sample..~~~Focus on problem, not solution~~~ |
 |
|
|
|
|
|
|
|