February 10, 2009 at 6:17 am
Hi Experts,
Our SQL Server getting lock timeout error 1222 when running the below given query
CREATE PROC [devidp].[AD_DelRKN]
(
@RKNID int
)
AS
SET NOCOUNT ON;
BEGIN TRANSACTION DelRKN
DELETE FROM RKN_address WHERE RKN_id=@RKNId
DELETE FROM RKN_contact_media WHERE RKN_id=@RKNId
DELETE FROM person_RKN WHERE RKN_id=@RKNId
DELETE FROM RKN WHERE RKN_id=@RKNId
SELECT 1
COMMIT TRANSACTION DelRKN
IF @@TRANCOUNT=0
BEGIN
ROLLBACK TRANSACTION DelRKN
SELECT 0
END
SET NOCOUNT OFF;
Please help me in resolving this issue.
TIA
February 10, 2009 at 6:26 am
are there any triggers on those tables?
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
February 11, 2009 at 2:07 am
Thanks for the reply Christopher,
The tables dont have any triggers. Is there any problem with the logic or order of execution in that query?
February 11, 2009 at 4:06 am
What's blocking the query?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 11, 2009 at 4:07 am
first run a portion then add some extent and loop it.
Thanks
February 11, 2009 at 4:57 am
How many rows are those deletes going to affect?
You're running that in a transaction, but there's no error handling at all. The commit is always going to fire, regardless of any errors that the deletes encounter. Is that what you want?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply