Multiple problems with a running job
From: Scott M. Lyon (scott.RED.lyon.WHITE_at_rapistan.BLUE.com)
Date: 11/03/04
- Next message: Mal .mullerjannie_at_hotmail.com>: "RE: Debbuging"
- Previous message: Aaron [SQL Server MVP]: "Re: Automating a backup job?"
- Next in thread: Adam Machanic: "Re: Multiple problems with a running job"
- Reply: Adam Machanic: "Re: Multiple problems with a running job"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 3 Nov 2004 10:30:34 -0500
I've got a stored procedure that essentially consists of about a half dozen
CURSORs (one after the other, not nested), each of which processes some
data. Each CURSOR has a source that is a SELECT with at least one INNER JOIN
(which I cannot change).
I'm trying to run this stored procedure as a job on our SQL server (so it
will run regardless of whether I'm there or not, or if my PC is on or not).
Here are the two major problems I'm having:
1) The job is locking my source database (despite the fact that it's a
database that I know is unchanging), making it impossible for me to run
multiple instances of the job simultaneously
2) When the job is running, I cannot even go into Enterprise Manager, and
the databas in question, and Management->Current Activity, as it locks up my
machine (never coming back) - I suspect this may be related to the locking
issue mentioned above.
First of all, I'm declaring the cursors as LOCAL STATIC.
Second, for every FROM and JOIN, after the table name I'm including WITH
(NOLOCK, READUNCOMMITTED) to prevent locks. Obviously this isn't working as
planned.
Can anyone offer suggestions what I can try to resolve both issues?
Thanks!
- Next message: Mal .mullerjannie_at_hotmail.com>: "RE: Debbuging"
- Previous message: Aaron [SQL Server MVP]: "Re: Automating a backup job?"
- Next in thread: Adam Machanic: "Re: Multiple problems with a running job"
- Reply: Adam Machanic: "Re: Multiple problems with a running job"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|