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 |
pmotewar
Yak Posting Veteran
62 Posts |
Posted - 2010-08-20 : 05:41:06
|
Hi all,i have 1 table having 30 rows. when i execute select statement likeselect * from transaction_tempit will not retrive the records.but if i execute it with top statement likeselect top 20 * from transaction_tempit will give me 20 records.but if if execute with top 21select top 21 * from transaction_tempit wont give me result.please suggest the solution. i am newbee in T-sql.Pankaj |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-08-20 : 06:03:21
|
What do you mean 'it won't give result'? It returns no records? It throws an error? something else?--Gail ShawSQL Server MVP |
 |
|
pmotewar
Yak Posting Veteran
62 Posts |
Posted - 2010-08-20 : 06:10:48
|
quote: Originally posted by GilaMonster What do you mean 'it won't give result'? It returns no records? It throws an error? something else?--Gail ShawSQL Server MVP
it gives timeout expired error.Pankaj |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-08-20 : 06:24:14
|
Sounds like there's a lock on one of the rows. Is there a DBA there? Someone who knows how to check for locks and blocking?--Gail ShawSQL Server MVP |
 |
|
pmotewar
Yak Posting Veteran
62 Posts |
Posted - 2010-08-20 : 06:53:59
|
quote: Originally posted by GilaMonster Sounds like there's a lock on one of the rows. Is there a DBA there? Someone who knows how to check for locks and blocking?--Gail ShawSQL Server MVP
Unfortunately our DBA is on leave. can you please provide me query to check lock n blocking ??Pankaj |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-08-20 : 07:19:15
|
Here is a startSELECT OBJECT_ID('transaction_temp') AS ObjIDEXEC master..sp_lock Now look for a record with same ObjID as first value. N 56°04'39.26"E 12°55'05.63" |
 |
|
|
|
|