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.
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 AnalyzerSELECT TOP 5 * FROM MYTABLESometimes 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 |
|
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. |
|
|
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 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
|
|
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 descran 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 thequery and closed query analyzer and got following error message:ISQL/W - SQL graphical query tool has stopped workingFYI I'm using vista since Jan 2007. Never seen this before. So I'm just wondering is this some vista related bug?Thanks. |
|
|
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. |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|