Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 24th, 2003, 03:57 AM
guidorobben guidorobben is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 1 guidorobben User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Passthrough Query creates big record lock

HI,

I have a question. When I run a passthrough query in Acces, It creates a big lock on table tbl_Contacts.. The strange thing is that I only use this query for show, not for editing. Can anybody explain to me how this happens?? When I set the rowcount to 120 then No lock appears. But when I remove the rowcount, sometinh like 2000 locks appear in my Current Activity. The query without the rowcount returns 440 records..

Regards,


Guido


Query
----------------------
exec spCallScript_CallsToCall_CallActive 94,17, 1



SP
----
CREATE PROCEDURE spCallScript_CallsToCall_CallActive @ProjectID int, @ScriptID int, @CallActive int AS
--set rowcount 120
set nocount on

--Declare @ScriptID int
--select @ScriptID = 7

--1 = A: maximimale belpoginh
--2 = C: Completed Script
--12 = cllback
--5 = wrong call
--14 = broken call


SELECT
--tbl_Companies.ProjectID,
tbl_Companies.*,
tbl_Contacts.*,
CallContacts.ContactID
FROM
tbl_Companies INNER JOIN (tbl_Contacts LEFT JOIN (SELECT DISTINCT tbl_Calls.ContactID FROM tbl_Calls WHERE (((tbl_Calls.ScriptID)= @ScriptID) AND ((tbl_Calls.CallCode)=2 Or (tbl_Calls.CallCode)=1 Or (tbl_Calls.CallCode)=5 or (tbl_Calls.CallCode)=12 or (tbl_Calls.CallCode)=14) )) CallContacts ON tbl_Contacts.Contact_ID = CallContacts.ContactID) ON tbl_Companies.Company_ID = tbl_Contacts.CompanyID
WHERE
(((tbl_Companies.ProjectID)=@ProjectID) AND
((CallContacts.ContactID) Is Null) AND
--((tbl_Companies.CO_ProjectCode) ='1'));
--Die 2 is er ff tijdelijk bijgezet
((tbl_Companies.CallActive)=@CallActive or (tbl_Companies.CallActive)=2))
--((tbl_Companies.CallActive)=2))
order by
(tbl_Companies.CallActive) desc,
(tbl_Companies.co_postalcode);
GO

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > Passthrough Query creates big record lock


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT