﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8)  / count(*) taking forever... emergency / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 06:01:13 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: count(*) taking forever... emergency</title><link>http://www.sqlservercentral.com/Forums/Topic1369366-392-1.aspx</link><description>For the nolock, see - [url]http://blogs.msdn.com/b/davidlean/archive/2009/04/06/sql-server-nolock-hint-other-poor-ideas.aspx[/url]</description><pubDate>Sun, 07 Oct 2012 03:16:20 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: count(*) taking forever... emergency</title><link>http://www.sqlservercentral.com/Forums/Topic1369366-392-1.aspx</link><description>Thanks guys. I will read up on that.</description><pubDate>Sat, 06 Oct 2012 23:10:10 GMT</pubDate><dc:creator>vick.ram79</dc:creator></item><item><title>RE: count(*) taking forever... emergency</title><link>http://www.sqlservercentral.com/Forums/Topic1369366-392-1.aspx</link><description>Chapter 6: [url]http://www.simple-talk.com/books/sql-books/troubleshooting-sql-server-a-guide-for-the-accidental-dba/[/url] (Blocking)</description><pubDate>Sat, 06 Oct 2012 03:05:38 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: count(*) taking forever... emergency</title><link>http://www.sqlservercentral.com/Forums/Topic1369366-392-1.aspx</link><description>[quote][b]vick.ram79 (10/6/2012)[/b][hr]yup - the nolock is soo much faster...[/quote]I am not suggesting that you use NOLOCK in your stored procedure.You should investigate why your query is being blocked.  You may have a long running or uncommited transaction that is causing a problem.</description><pubDate>Sat, 06 Oct 2012 01:44:44 GMT</pubDate><dc:creator>Michael Valentine Jones</dc:creator></item><item><title>RE: count(*) taking forever... emergency</title><link>http://www.sqlservercentral.com/Forums/Topic1369366-392-1.aspx</link><description>yup - the nolock is soo much faster...</description><pubDate>Sat, 06 Oct 2012 00:51:43 GMT</pubDate><dc:creator>vick.ram79</dc:creator></item><item><title>RE: count(*) taking forever... emergency</title><link>http://www.sqlservercentral.com/Forums/Topic1369366-392-1.aspx</link><description>Try running the statement below.  If it runs much faster, your original query is probably being blocked.[code="sql"]select COUNT(*) from TransactionLog with (nolock)[/code]</description><pubDate>Fri, 05 Oct 2012 22:50:19 GMT</pubDate><dc:creator>Michael Valentine Jones</dc:creator></item><item><title>RE: count(*) taking forever... emergency</title><link>http://www.sqlservercentral.com/Forums/Topic1369366-392-1.aspx</link><description>Have you checked for any blocking?</description><pubDate>Fri, 05 Oct 2012 20:44:36 GMT</pubDate><dc:creator>Lynn Pettis</dc:creator></item><item><title>count(*) taking forever... emergency</title><link>http://www.sqlservercentral.com/Forums/Topic1369366-392-1.aspx</link><description>Team - Friday night is turning bad for me...One of my SPs was taking forever and after a long haul I have nailed it down to one table "TransactionLog" in my db.Even the statement below is taking forever:[code="sql"]select COUNT(*) from TransactionLog[/code]Just not ending... Can anyone tell what could be the reason??I ran a dbcc check:[code="sql"]DBCC CHECKTABLE ("dbo.TransactionLog")[/code]The output was:[code="sql"]DBCC results for 'TransactionLog'.There are 67632 rows in 531 pages for object "TransactionLog".DBCC execution completed. If DBCC printed error messages, contact your system administrator.[/code]</description><pubDate>Fri, 05 Oct 2012 20:36:10 GMT</pubDate><dc:creator>vick.ram79</dc:creator></item></channel></rss>