>Here's an example of a DELETE SP that checks for a foreign key constraint violation and then any other errors:
>
>-- Determine if a foreign key constraint has been violated.
>IF @nError = 547
> BEGIN
> RAISERROR('This community is already in use and cannot be deleted.',11,1)
> GOTO err_handler
> END
Well, a wizard can't really create custom messages for you, but you are free to add them yourself to the script that the wizard generates (or right in the wizard if you want, if you want the wizard to add the sprocs directly).
>I typically check the @@ERROR function after every SQL statement. If an error occurs, the message can can be retrieved using AERROR() in my data service object (have to do some parsing.)
It can be retreived from the data access object regardless...
Erik Moore
Clientelligence