Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

try catch blocks Expand / Collapse
Author
Message
Posted Saturday, October 16, 2010 7:34 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, October 31, 2012 1:16 AM
Points: 127, Visits: 348
in sql server 2005 in SP.... i have a try- catch block.... in try block based on condition can i diverted to coltrol to catch block?


begin try
begin transaction
insert stmt
if value>1
--it should rollock
commit
end try

begin catch
if @@transcount>0
rollback
end catch


or can i use rollback in try block itself?
Post #1005726
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse