August 7, 2007 at 3:06 pm
Hello,
I've got a very strange issue that I'm hoping someone can help with.
Basically, I've inherited an application that makes a call to a SQL Server 2000 database. If I run a simple query against the database like so using SQL Server 2005 express:
select * from tablename where id=specificid
I return 3 distinct records from the table. However, if my Sysadmin, using SQL Server 2000 Query Browser directly from the server enters the same query, he only returns one record.
Any ideas as to why this might happen? The table in question contains Int, SmallInt and text fields only. It doesn't seem as if the two applications should return differing records--not to mention that we need to recover those additional records as well.
August 7, 2007 at 6:52 pm
Possibly a silly question, but are you sure you are both connecting to the same server? I had a phone call just the other day where someone was connecting to an older copy of the database (marked read-only & restricted!) on SQL 2000 when they should've been connecting to the same DB on SQL 2005.
When you say "run a simple query against the database like so using SQL Server 2005 express", are you stating that you're using the SQL Server Management Studio Express Edition application to connect to SQL Server 2000, or are you using the said application to connect to SQL Server 2005 Express Edition?
You could verify the potential similarity/difference confusion of databases I suppose by checking the results of the following query on each server
select count(*) from tablename
Also, this problem *could* be caused by a corrupted index on the id column.... To check this run
dbcc checkdb(dbName)
August 8, 2007 at 12:44 am
And watch out for two tables with the same name but different owners in the same database e.g.
dbo.ThisWillConfuseHim
jdavies.ThisWillConfuseHim
db
The systems fine with no users loggged in. Can we keep it that way ?br>
August 8, 2007 at 7:18 am
In fact, that's what it turned out to be. Thanks for your help.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply