What are some of the possible scenarios that will generate
incorrect results querying data with T-SQL statements?
Rick
Rick
John
Quote:> What are some of the possible scenarios that will generate
> incorrect results querying data with T-SQL statements?
> Rick
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.
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