Hi,
i'd like to create a stored procedure in SQL 2000 that runs some insert statements (let's say 3 of them). This stored procedure will actually be called from another stored procedure from another database.
What i would like to have happen is if any of the insert statements fail for some reason, i would like to stop the execution of the stored procedure and rollback any transactions and return a value of 1 to the calling stored procedure.
if all the statements are successfull i want to commit the transactions and return a 0 back to the calling procedure.
Does anyone have an example of what this syntax would look like?
i've never used return or output variables before so i'm not too familiar with them.
thanks
Scott
i'd like to create a stored procedure in SQL 2000 that runs some insert statements (let's say 3 of them). This stored procedure will actually be called from another stored procedure from another database.
What i would like to have happen is if any of the insert statements fail for some reason, i would like to stop the execution of the stored procedure and rollback any transactions and return a value of 1 to the calling stored procedure.
if all the statements are successfull i want to commit the transactions and return a 0 back to the calling procedure.
Does anyone have an example of what this syntax would look like?
i've never used return or output variables before so i'm not too familiar with them.
thanks
Scott