Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple select statemet times-out 1

Status
Not open for further replies.

Yale

Programmer
Sep 30, 2004
31
US
help!!! how come a simple "select top 1 * from mytable" times-out when the statement is supposed to just display a single row? how do i solve this?

thanks,
yale
 
There is more things, one of them is that there should
be started another transaction that is using your table and
than your statement is waiting that transaction to finish.
If you have Enterprise Manager, you can look what transactions
are running at Management \ Current Activity option.

Also, is "mytable" physical table or is it view ?

Zhavic

---------------------------------------------------------------
In the 1960s you needed the power of two Comodore64s to get a rocket to the moon. Now you need a machine which is a vast number of times more powerful just to run the most popular GUI.
 
hi zhavic,
"mytable" is a table... anyways, good news -- we've already found-out what is causing the issue... you are correct... all transactions are being blocked by another running transaction... we were able to determine this using sp_who2...
thanks,
yale
 
ANOTHER HANDY TIP:

IF
select top 1 * from mytable

doesn't run but:

select top 1 * from mytable with (nolock)

runs, this means you were blocked.


"A long life is when each day is full and every hour wide!"
(A Jewish Mentor)
M. [hourglass]

 
i have a follow-up question... how do i resolve the blocking issue? is there something that i could place in the sql script that is causing the blocking of transactions?

thanks again!

YALE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top