You can create your own error messages and numbers using sp_addmessage that you can raise with RAISERROR. System errors will automatically set @@ERROR to the message number. How you handle them at the server is up to you.
>
> I know that I can call raiserror function inside the stored procedure with the option WITH SET ERROR and set the variable @@error. Thus, I can get it with a sentence SPT and handle it in VFP. But, is there any way to get the custom erro message direct?
> Do you have any suggestions to handle other error types like violation in PK, violations in constraints, etc... I prefer to solve any kind of problem in server rather than in my application.
>
>Thanks in advance.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05