Microsoft
Software
Hardware
Network
Question : SQL 2008 SP1 Ghost count!
Hi Experts, when sql server is very busy I get Ghost counts when using statement 2, statement 1 works fine, however, when the server is idle both the statements come up with the same correct results! Aaargh!!
Is there a setting on the server that can fix this?
The two fields are JobUID (Uniqueidentifier) and EntityType nchar(2).
Cheers and look forward to your answers!
DECLARE @JobUID uniqueidentifier, @EntityType nchar(2),
SET @JobUID = '1e259920-326d-4469-ba23-5
041e307f9b
8'
SET @EntityType = 'GE';
-- 1
SELECT count([id]) AS TotalRowsInTable
FROM [DQEMail].[dbo].[EMailVali
datorResul
ts]
where JobUID = '1e259920-326d-4469-ba23-5
041e307f9b
8' and EntityType='GE'
TotalRowsInTable
4154744 (Correct count)
-- 2 Ghost count result
SELECT count([id]) AS TotalRowsInTable
FROM [DQEMail].[dbo].[EMailVali
datorResul
ts]
where [JobUid]= @JobUID and EntityType=@EntityType
TotalRowsInTable
4154782 (Incorrect count)
Answer : SQL 2008 SP1 Ghost count!
try repeattable read first
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
if that causes problems (deadlocks) drop back to read committed...
Random Solutions
ERROR: Windows Live Messenger has stopped working
asp.net - Is there anyway that you can detect that a label evals to nothing and trigger an event to alert the user that they need do something.
Get rid of tab color on all tabs between 2 tabs
How to set the reportViewer to Print Layout
How do I enable the Create Email button in Access 2007 forms?
Why aren't all my profiles showing up with I boot up in SAFE MODE?
Manual Update of WSUS Data Files
Access DB network performance very slow
Calculate Week depending on Payroll or pay perioud
Using cookies with ASP.NET