Re: Multiple problems with a running job
From: Adam Machanic (amachanic_at_hotmail._removetoemail_.com)
Date: 11/03/04
- Next message: Aaron [SQL Server MVP]: "Re: change server default dateformat"
- Previous message: Marius: "Using WHERE ... IN (@Var)"
- In reply to: Scott M. Lyon: "Multiple problems with a running job"
- Next in thread: Scott M. Lyon: "Re: Multiple problems with a running job"
- Reply: Scott M. Lyon: "Re: Multiple problems with a running job"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 3 Nov 2004 10:38:17 -0500
Can you post your code as well as a narrative about what it's doing and why?
-- Adam Machanic SQL Server MVP http://www.sqljunkies.com/weblog/amachanic -- "Scott M. Lyon" <scott.RED.lyon.WHITE@rapistan.BLUE.com> wrote in message news:eZSsYobwEHA.3292@TK2MSFTNGP15.phx.gbl... > 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: Aaron [SQL Server MVP]: "Re: change server default dateformat"
- Previous message: Marius: "Using WHERE ... IN (@Var)"
- In reply to: Scott M. Lyon: "Multiple problems with a running job"
- Next in thread: Scott M. Lyon: "Re: Multiple problems with a running job"
- Reply: Scott M. Lyon: "Re: Multiple problems with a running job"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|