Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Data Corruption Issues
 Table not behaving properly

Author  Topic 

ssalim
Starting Member

2 Posts

Posted - 2009-02-02 : 14:10:28
Hi,

I have this table that giving different results on 2 queries.
Let's say the table has these columns:

name // zip

this query:
select * from tablename where name = 'AAA'

gives this result:
1 // AAA // 92000
2 // AAA // 92001
3 // AAA // 92002

however, this query:
select * from tablename where name = 'AAA' and zip = 92003

should returns 0 right?
not this time. It gives:

1 // AAA // 92003

... so what gives?

Thanks!

Edit: I'm on Microsoft SQL Server 2000

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-02-02 : 15:51:29
where are you running this query ? Any chance that it returns top 3 records or so ?
Go to Top of Page

ssalim
Starting Member

2 Posts

Posted - 2009-02-02 : 16:03:33
I'm running on SQL Server management studio. No, no top 3 or set rowcount statements.

Thanks for reply.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-02 : 18:54:21
You need to check records properly.
Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2009-02-03 : 09:36:11
quote:
Originally posted by sodeep

You need to check records properly.



I agree. It's not corruption. What does select * from tablename where zip = 92003 yield? It appears you don't know what the data set is....but it's definitely not SQL-related.


Terry

-- Procrastinate now!
Go to Top of Page
   

- Advertisement -