Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
Administration
»
Deadlocked SQL Agent job
Deadlocked SQL Agent job
Rate Topic
Display Mode
Topic Options
Author
Message
Casper101
Casper101
Posted Wednesday, December 05, 2012 9:38 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Monday, May 20, 2013 7:38 AM
Points: 107,
Visits: 859
Hi,
I have a SQL 2000 Agent job that executes a stored procedure which populates a table from a file.
The code in the SP is not within a transaction and the EXEC of the proc is also not in a transaction. It is just a SQL Agent job.
It happens every now and again that this job fails with an error message indicating that it was a deadlock victim.
My question is:
Will the queries in the proc roll back when this deadlock occurs?
OR
Will it import the file up to a the point of deadlock and then just stop - meaning an incomplete import?
Post #1393090
arunyadav007
arunyadav007
Posted Wednesday, December 05, 2012 10:35 AM
SSC Rookie
Group: General Forum Members
Last Login: Friday, May 03, 2013 3:06 AM
Points: 42,
Visits: 285
Hello Casper,
According to my knowledge of deadlocks,
Deadlocking occurs when two or more user processes have locks on separate objects and each process is trying to acquire a lock on the object that the other process has locked. When this happens, SQL Server resolves the deadlock by automatically aborting one process, the "victim" process, allowing the other processes to continue.
The aborted transaction is rolled back and an error message is sent to the user of the aborted process. Generally, the transaction that requires the least amount of overhead to roll back is the transaction that is aborted.
So, theoritically, in your case, the table should not be populated at all.
Please refer to the below articles on handling deadlocks:
http://sqlserverpedia.com/wiki/Handling_Deadlock_Conditions_with_TRY_/_CATCH
http://www.simple-talk.com/sql/database-administration/handling-deadlocks-in-sql-server/
Let me know if it solves your query...
Post #1393121
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.