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.
| Author |
Topic |
|
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2008-10-27 : 16:17:12
|
| hiI have an update StoreProc. ALTER PROCEDURE [dbo].[spA]ASBEGINSET NOCOUNT ON;exec spDisableTrgUpdate dbo.tblAset CLDNO = B.IND_CLDNO,from tblA, tblB Bwhere tblA.CLDNO = B.IND_CLDNOif @@error <> 0 exec spenableTrgelsedelete from tblBexec spenableTrgEND Is there anyway that i could rollback and at the same time enable the trigger if @@error <> 0? I am not able to have both statement to run at the same time. Thanks |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-10-27 : 16:35:31
|
| try using the try catch construct and reenable the trigger at the end of try or in the catch part._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out! |
 |
|
|
|
|
|