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
 Transact-SQL (2000)
 sql server 2005 error handling

Author  Topic 

fmardani
Constraint Violating Yak Guru

433 Posts

Posted - 2006-02-22 : 08:45:36
Hi,
Could you please send a little sql script with several try catch statements?
In sql 2000 I do something like:

select * from table1
if @@error > 0
raiseerror...

select * from table2
if @@error > 0
raiseerror...

Basically I would like to know if I should use begin try end try begin catch end catch for each sql styatement. So does that mean I will end up having several try catch statement (one for each sql)?

Thanks

Norwich
Posting Yak Master

158 Posts

Posted - 2006-02-23 : 05:27:32
visit this link:

[url]http://msdn2.microsoft.com/en-us/library(d=robot)/ms175976.aspx[/url]

N

The revolution won't be televised!
Go to Top of Page
   

- Advertisement -