incorrect reports

incorrect reports

Post by rick » Sun, 08 Jun 2003 15:40:10



What are some of the possible scenarios that will generate
incorrect results querying data with T-SQL statements?

Rick

 
 
 

incorrect reports

Post by John Bel » Sun, 08 Jun 2003 15:57:02


If you have table or index corruption, your output may be effected. Try
using the DBCC commands to verify your database is not corrupt.

John


Quote:> What are some of the possible scenarios that will generate
> incorrect results querying data with T-SQL statements?

> Rick


 
 
 

incorrect reports

Post by Dan Guzma » Sun, 08 Jun 2003 17:45:58


Aside from physical corruption, the other possible cause of incorrect
results is a SQL Server bug.  However, it's important to distinguish
between *incorrect* results and *unexpected* results.  For example, the
following causes a log of folks grief:

CREATE TABLE Table1
    (Table1Data int)
CREATE TABLE Table2
    (Table2Data int)
GO

INSERT INTO Table1 VALUES(1)
INSERT INTO Table2 VALUES(2)
GO

SELECT * FROM Table1
WHERE Table1Data NOT IN
    (
    SELECT Table2Data FROM Table2
    )
GO

INSERT INTO Table2 VALUES(NULL)
GO

SELECT * FROM Table1
WHERE Table1Data NOT IN
    (
    SELECT Table2Data FROM Table2
    )
GO

--
Hope this helps.

Dan Guzman
SQL Server MVP

-----------------------
SQL FAQ links (courtesy  Neil Pike):

http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------


Quote:> What are some of the possible scenarios that will generate
> incorrect results querying data with T-SQL statements?

> Rick

 
 
 

1. Incorrect Reporting of Available Space

I am using SQL Server 6.5 and my problem is that when I use the GUI in
Enterprise Manager to check the amount of data space available in one of
my databases, call it X (I usually click Manage -> Databases to bring up
the graphical representation), it is being reported as being 0.00MB even
though I can still write data to tables in the database and sp_spaceused
reports that there is space available as well. Even after double
clicking database X in the "Manage Databases" window and clicking on
"recalculate" the available space is still reported as zero.

I have tried running several DBCC commands to try to correct the problem
such as checkdb, checkalloc, checkcatalog and updateusage but the graph
still shows the available space as zero.

Is there a way to have the graph show the correct values (maybe an SP
that I can use) or should I just rely on the results reported by
sp_spaceused?

Thanks,

K.Warner

2. Connect a java program with an oracla DB

3. Bug?: Incorrect reporting in Grid View

4. Absolute path to access database. Please help

5. SQL 6.5 Database reporting incorrect freespace

6. db2uext2 call causes access violation

7. SQLPERF (LOGSPACE) reports incorrect percentage used.

8. Emerald Bay C Toolkit

9. Incorrect session parameters Error from Crystal reports

10. SYSINDEXES.ROWCNT reporting incorrect number of rows?

11. Incorrect database size reported in EM

12. 6.5 EM reports DB&Log size incorrect

13. Incorrect Number of Users Reported