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 |
|
Sql_forum
Yak Posting Veteran
50 Posts |
Posted - 2011-11-28 : 04:57:58
|
| What is the error code range that i can use for custom error messages in sql? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-28 : 05:03:38
|
| Usually values greater than 50000 are given for custom message numbers------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
7siva7
Starting Member
28 Posts |
Posted - 2011-11-28 : 05:07:27
|
| How can we use custom error messages ...can you give me a syntax or example code?HI |
 |
|
|
Sql_forum
Yak Posting Veteran
50 Posts |
Posted - 2011-11-28 : 05:13:50
|
| RAISERROR (50005,16,1)Is the above way using RAISERROR is correct?? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-28 : 07:27:16
|
quote: Originally posted by Sql_forum RAISERROR (50005,16,1)Is the above way using RAISERROR is correct??
yes it isand message can be added before using sp_addmessage------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Sql_forum
Yak Posting Veteran
50 Posts |
Posted - 2011-11-29 : 06:53:02
|
| What if i didn't add message?I m trying to execute Procedure in C#... but it is not returnig me error code |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-29 : 06:57:27
|
quote: Originally posted by Sql_forum What if i didn't add message?I m trying to execute Procedure in C#... but it is not returnig me error code
If you didnt add message already, you need to explicitly include it in RAISERROR------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|