Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ask SQLTeam Question

0 Posts

Posted - 09/19/2006 :  07:43:19  Show Profile  Visit AskSQLTeam's Homepage
priya writes "what is the best method to count the number of records in a table?"

Patron Saint of Lost Yaks

30421 Posts

Posted - 09/19/2006 :  07:53:09  Show Profile  Visit SwePeso's Homepage
select count(*) from MyTable (nolock)

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Flowing Fount of Yak Knowledge

5581 Posts

Posted - 09/19/2006 :  08:13:28  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message

SELECT rows FROM sysindexes WHERE id = OBJECT_ID('table_name') AND indid < 2

Much faster, less reliable !

Harsh Athalye
"Nothing is Impossible"
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000