dbTalk Databases Forums  

Return all rows works partially

microsoft.public.sqlserver.server microsoft.public.sqlserver.server


Discuss Return all rows works partially in the microsoft.public.sqlserver.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Peter CCH
 
Posts: n/a

Default Return all rows works partially - 12-02-2005 , 03:44 AM






I encounter a problem where returning all rows from a certain table in
SQL server 2000, the records sometimes can be return sometimes not.

In Enterprise Manager, I browse to a table, then I right click on it,
click "Open table > Return all rows" ... it just keep waiting until it
timeout. It didn't return any result. But when I "Return top" ... with
returning top 71, the records will shown. When I try to return top 72,
it happen again, with no result returned and timeout. I'd try a few
times with different value, it always happen when I try to return rows
until row 72.

I'd try it in Query Analyzer, it's the same.
It return rows when "SELECT TOP 71 * FROM theTableName"
but no response when "SELECT TOP 72 * FROM theTableName"

Anyone encounter this problem before? Is it the index of that table
corrupted? Or values inside that rows cannot be return?

Any idea how to solve this?

Thanks.



Peter CCH


Reply With Quote
  #2  
Old   
Tibor Karaszi
 
Posts: n/a

Default Re: Return all rows works partially - 12-02-2005 , 04:23 AM






Possibly someone has a lock on the row which will be read as row number 72 by the selected execution
plan. Check using sp_lock, sp_who etc.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/


"Peter CCH" <petercch.wodoy (AT) gmail (DOT) com> wrote

Quote:
I encounter a problem where returning all rows from a certain table in
SQL server 2000, the records sometimes can be return sometimes not.

In Enterprise Manager, I browse to a table, then I right click on it,
click "Open table > Return all rows" ... it just keep waiting until it
timeout. It didn't return any result. But when I "Return top" ... with
returning top 71, the records will shown. When I try to return top 72,
it happen again, with no result returned and timeout. I'd try a few
times with different value, it always happen when I try to return rows
until row 72.

I'd try it in Query Analyzer, it's the same.
It return rows when "SELECT TOP 71 * FROM theTableName"
but no response when "SELECT TOP 72 * FROM theTableName"

Anyone encounter this problem before? Is it the index of that table
corrupted? Or values inside that rows cannot be return?

Any idea how to solve this?

Thanks.



Peter CCH



Reply With Quote
  #3  
Old   
Peter CCH
 
Posts: n/a

Default Re: Return all rows works partially - 12-02-2005 , 04:59 AM



But I'm the only one user who access to that database while I doing
that.


Peter CCH


Reply With Quote
  #4  
Old   
Tibor Karaszi
 
Posts: n/a

Default Re: Return all rows works partially - 12-02-2005 , 05:45 AM



I'd still check for blocking. It could be an open transaction hanging around or something, you never
know. Other possible reasons:

73 vs 72 rows lead to different execution plans. Check using estimated execution plan.

Table corruption. Check using DBCC CHECKDB or DBCC CHECKTABLE.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/


"Peter CCH" <petercch.wodoy (AT) gmail (DOT) com> wrote

Quote:
But I'm the only one user who access to that database while I doing
that.


Peter CCH



Reply With Quote
  #5  
Old   
Robert Klemme
 
Posts: n/a

Default Re: Return all rows works partially - 12-02-2005 , 08:58 AM



Tibor Karaszi wrote:
Quote:
I'd still check for blocking. It could be an open transaction hanging
around or something, you never know. Other possible reasons:

73 vs 72 rows lead to different execution plans. Check using
estimated execution plan.

Table corruption. Check using DBCC CHECKDB or DBCC CHECKTABLE.
Could as well be a too low timeout value, couldn't it?

robert



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.