Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 23rd, 2006, 01:09 AM
Registered User
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jeff here's the SP
---
the number of operators for whom this RecordSet is returned from the SP is approx. 80


ALTER Procedure dbo.usp_Opr_Productivity_Fetch
    @PUserId varchar(30),
    @PFromDate datetime,
    @PToDate datetime
as
Begin
    IF @PFromDate is null
        Set @PFromDate = dateadd(day,-1,getdate())

    IF @PToDate is null
        Set @PToDate = getdate()
    select count(al_id) No_of_Forms,al_formgroup FormGroup,AL_DE1Processing Processing_Flag,al_action Operator_Action,AL_OPERATORID UserID, UL_UserName FullName
        , sum(isnull(OE_ErrorCount,0)) error_Count
    from userlogin u,auditlog a left outer join operatorError o
        on o.oe_batchname = al_functionname and o.oe_operatorid =AL_OPERATORID and o.oe_de1processingflag =al_de1processing and oe_datachangedto not like 'Other'
    where al_operatorid = ul_userid and al_action in ('dataentry','hold') and
        al_createdon > @PFromDate and al_Createdon <= @PToDate
    group by al_formgroup,AL_DE1Processing,al_action,AL_OPERATO RID,UL_UserName
    order by al_operatorid,al_formgroup,AL_ACTION
End
 
Old November 20th, 2007, 08:49 PM
Registered User
 
Join Date: Nov 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have been fighting the same fight for the last week. I am now very much inclined to believe that this is often a locking problem on SQL server. My VBA code works nicely until suddenly it does not at all. So, in trying this and that today I used Enterprise Manager, found every process related to locks and killed them all. Now everything seems to be smooth and proper. Note I have the luxury of developing on an isolated development SQL server so killing all locks is not as dangerous as it might sound. I have also found that I only need to kill some select locks for my program to be happy again.

Now, I get to contemplate what is causing the locks to not unlock. My 2007 Access db is set to lock edited record only. I suspect that, as I am in development mode, that locks are not unlocking as a result of premature program termination (ie crashes).

So, suggestions anyone on how to check SQL server from VBA to test for existing locks and then unlocking them, say, when a program starts up?

Locks are found in Enterprise Mgr: SQL Server Group -> Management -> Current Activity






Similar Threads
Thread Thread Starter Forum Replies Last Post
Login Timeout Expired error smnel ASP.NET 2.0 Basics 0 May 7th, 2008 06:58 AM
Timeout Expired Error dhara_adh SQL Server 2000 4 December 22nd, 2006 04:18 PM
Timeout Expired Error nikotromus SQL Server 2000 16 December 5th, 2006 03:54 PM
Timeout Expired Error dbalachandar SQL Server 2000 3 July 28th, 2006 01:35 AM
Timeout Expired Error vinod_pawar1 SQL Server 2000 5 July 17th, 2004 09:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.