Ask a Question related to Microsoft SQL / MS SQL Server, Design and Development.
-
Olaf Bönning #1
COUNTING PROBLEM !!!
I have a serious problem: Each time I run the following
query the count result is changing!
SELECT count(*) from posnad WHERE lfn_pos IS NULL
lfn_pos is defined as an 'int' and used as a foreign key.
The table is quite big (8,000,000 rows) and the count
result should return about 1,600,000 rows.
There are NO updates, insertions, deletions, triggers or
what ever on the table.
I am the only user. Transaction isolation level is READ
COMMITED and a already tried the SET NOCOUNT option.
Any ideas???
Regards,
------------
Olaf Bönning
IT Specialist
Olaf Bönning Guest
-
counting down in a for
Hi all there is probably a much better way of doing all this i am working on the checkResults sub. it should find the pollerAudit log created... -
Counting (easy!)
I'm sure this is easy but I'm a newbie. I was doing control statements (for, while,etc.) like this: for ($count = 1; $count <= 5; $count++) {... -
Counting (easy!) (YES!!)
I think I figured it out! A FIRST!! for ($i = 1; $i <= 5; $i++){ sleep 1; print "$i\n"; } I prints out like this: 1...2...3...4...5 -
#23132 [Csd]: Strange engine crash (reference counting problem)
ID: 23132 Updated by: moriyoshi@php.net -Summary: Strange engine crash Reported By: edink at proventum dot net... -
Counting files
Hi, I have a list: file1 file2 dir1/file3 dir1/file4 dir1/subdir1/file5 dir2/file6 -
Itzik Ben-Gan #2
Re: COUNTING PROBLEM !!!
Olaf, you'd be surprised how many times people were sure that nothing modified their tables and eventually found out they were wrong.
Try running a Profiler trace to monitor modifications against the table (you can set a filter on objectid).
--
BG, SQL Server MVP
Solid Quality Learning
[url]www.solidqualitylearning.com[/url]
"Olaf Bönning" <Olaf.Brecht@gmx.net> wrote in message news:050201c3444c$ba68cee0$a301280a@phx.gbl...
I have a serious problem: Each time I run the following
query the count result is changing!
SELECT count(*) from posnad WHERE lfn_pos IS NULL
lfn_pos is defined as an 'int' and used as a foreign key.
The table is quite big (8,000,000 rows) and the count
result should return about 1,600,000 rows.
There are NO updates, insertions, deletions, triggers or
what ever on the table.
I am the only user. Transaction isolation level is READ
COMMITED and a already tried the SET NOCOUNT option.
Any ideas???
Regards,
------------
Olaf Bönning
IT Specialist
Itzik Ben-Gan Guest
-
Greg Obleshchuk #3
Re: COUNTING PROBLEM !!!
Olaf,
The set nocount will not effect the count in your query
Try this
SELECT lfn_pos, count(*) as count from posnad group by lfn_pos
this will count per grouping of lfn_pos
Is posnad a table or query?
What version of SQL are you using?
Basicall if there really are no changes to the table then the fighures
should remain the same, I don't remember reading about any bugs like this in
the latest SP (I asume your on the latest SP?)
If posnad is a view then mayb the view details are changing?
--
I hope this helps
regards
Greg O MCSD
SQL Scribe Documentation Builder
Document any SQL server database in minutes
Programmers love it, DBA dream of it
AGS SQL Scribe download a 30 day trial today
[url]http://www.ag-software.com/ags_scribe_index.asp[/url]
"Olaf Bönning" <Olaf.Brecht@gmx.net> wrote in message
news:050201c3444c$ba68cee0$a301280a@phx.gbl...
I have a serious problem: Each time I run the following
query the count result is changing!
SELECT count(*) from posnad WHERE lfn_pos IS NULL
lfn_pos is defined as an 'int' and used as a foreign key.
The table is quite big (8,000,000 rows) and the count
result should return about 1,600,000 rows.
There are NO updates, insertions, deletions, triggers or
what ever on the table.
I am the only user. Transaction isolation level is READ
COMMITED and a already tried the SET NOCOUNT option.
Any ideas???
Regards,
------------
Olaf Bönning
IT Specialist
Greg Obleshchuk Guest
-
Olaf Bönning #4
COUNTING PROBLEM !!!
I started the execution plan in Query Analyzer and found
out that the numbers are calculated using an index scan
and not a table scan. Could my index be corrupt?
------------
Olaf Bönning
IT Specialist
Olaf Bönning Guest



Reply With Quote

