September 4, 2007 at 1:46 am
Hi Experts,
I want to know whether the last sql statement is executed successfully or not.
Say for example,
select * from emp
suppose if the 'emp' table doesn't exist in the database then it will give 'object doesn't exit' error message.
My question is i want to know the last executed sql statement is successfully completed or not.
Regards
Karthik
karthik
September 4, 2007 at 1:50 am
Have a look at @@error
http://technet.microsoft.com/en-us/library/ms188790.aspx
Regards,
Andras
September 4, 2007 at 2:00 am
shall we implement try...catch logic in sql2000 ?
Regards
Karthik
karthik
September 4, 2007 at 2:11 am
Hi Karthik,
it very much depends on your requirements. E.g. whether you can recover from an error, or you need to abort the transaction immediately. I would recommend you to read Erland Sommarskog's article on error handling in SQL Server 2000 and 2005. You can access it from his website under:
http://www.sommarskog.se/error-handling-I.html
Regards,
Andras
September 4, 2007 at 2:18 am
Thanks Andras !
Mentioned Article is very nice !
Regards
Karthik
karthik
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply