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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 strange problem

Author  Topic 

ssunny
Posting Yak Master

133 Posts

Posted - 2008-12-11 : 10:52:28
Hi All,
I'm having a weird problem today. When I run following query in Query Analyzer

SELECT TOP 5 * FROM MYTABLE

Sometimes I get 3 rows back, sometimes 4 and sometimes 5. I've never seen something like this. What could be the cause of this?
Thanks in advance.

X002548
Not Just a Number

15586 Posts

Posted - 2008-12-11 : 11:10:08
That the data is changing?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

ssunny
Posting Yak Master

133 Posts

Posted - 2008-12-11 : 11:16:25
Hey Brett,

No, that data is static. It's in dev environment and the table has around 200000 rows and I'm trying to select top 5.

Thanks.
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2008-12-11 : 11:26:27
Does it still do this if you provide a meaningful statement for the TOP?

SELECT TOP 5 * FROM <x> ORDER BY <y>



Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

ssunny
Posting Yak Master

133 Posts

Posted - 2008-12-11 : 11:55:29
Ok per Charlie's suggestion I ran following queries.

1.SELECT TOP 5 * FROM dbo.product order by pid desc

ran about 10 times and got exactly 5 rows at each time.

2.SELECT TOP 5 * FROM dbo.product order by pid

For this one behavior is inconsistent. I got 3, 4 or 5 rows. One time query ran for about 4 minutes and eventually I stopped the
query and closed query analyzer and got following error message:

ISQL/W - SQL graphical query tool has stopped working

FYI I'm using vista since Jan 2007. Never seen this before. So I'm just wondering is this some vista related bug?

Thanks.
Go to Top of Page

ssunny
Posting Yak Master

133 Posts

Posted - 2008-12-11 : 12:25:40
Guys, I think it’s a problem with my local sql server instance. I ran same queries on the server (which has windows XP) and they ran fine.
So I think there is no need to waste everybody's valuable time.
Thanks all for your input.

Sunny.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2008-12-11 : 13:18:42
waste? what waste? I've seen waste (Jon)

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -