SQL Server - Quick way to find the rowcount in a table.

By [)ia6l0 iii

Use the Sysindexes table to find the number of rows in a table.

SELECT rows FROM databaseName..sysindexes WHERE id = OBJECT_ID ('databaseName..tableName') AND indid < 2

Related FAQs

You can use the DBCC INDEXDEFRAG command to defrag the indexes on a table. It is a faster approach versus Rebuilding indexes. Also note that, DBCC INDEXDEFRAG commands are replaced with the ALTER INDEX command in versions starting from SQL SERVER 2005
Use Binary or VarBinary fields to store fixed or variable length. These were available in 2005 and 2008 versions only.
There is no workaround to change the datatype of a Timestamp column. You will have to drop the column and recreate it.
Varchar can store non-Unicode character data where as nvarchar can store Unicode character data.
Improper Dynamic SQL can cause this error.
The compound operator in SQL Server 2008 offers the simpler syntax which all developers looked for.
SQL Server - Quick way to find the rowcount in a table.  (624 Views)
Create New Account