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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 ERROR HANDLING

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-04-06 : 20:07:41
SHEKHAR writes "In the stored procedure, the SQL query is inserting records to the linked MS SQL database. Though the immidiate line after the insert statement is IF @@ERROR<>0, still the stored producdure is gets terminated and does not execute the statement inside the IF block. Any solutions?"

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2006-04-06 : 20:52:08
An error is occuring during your insert which as a severity level high enough to stop execution of your code. You did not post the error but chances are it is a constraint violation. Most of these errors can be caught by anticipating what error could occur, test for the error condition and only attempt the insert if your test is successfull. Feel free to post your SP along with the error that is returned and someone here can help you with a specific solution.

Be One with the Optimizer
TG
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-07 : 01:12:41
Read this to know more about error handling
http://www.sommarskog.se/error-handling-I.html

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -