How do you find the number of rows in a table?

Answer Posted / manoj savalia

Try This

SELECT SYS_OBJ.NAME AS "TABLE NAME"
, SYS_INDX.ROWCNT AS "ROW COUNT"
FROM SYSOBJECTS SYS_OBJ, SYSINDEXES SYS_INDX
WHERE SYS_INDX.ID = SYS_OBJ.ID
AND INDID IN(0,1)
AND XTYPE = 'U'
AND SYS_OBJ.NAME <> 'SYSDIAGRAMS'
AND SYS_INDX.ROWCNT>0
ORDER BY SYS_INDX.rowcnt DESC

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is dbcc?

597


Can we take the full database backup in log shipping?

546


what is an index? : Sql server database administration

527


Can you get second highest salary from the table?

557


You want to use a perspective in an mdx query. How do you select the perspective?

157






Explain iaas, paas and saas?

74


Explain what is it unwise to create wide clustered index keys?

549


According to you what goes into making the best database administrator? : sql server database administration

551


Which joins are sql server default?

514


Difference between LEN() and DATALENGTH() in sql server ?

596


Benefits of Stored Procedures?

574


Explain relational data?

553


How to create view in stored procedure sql server?

507


Are semicolons required at the end of sql statements in sql server 2005?

570


Which is the best place or learning center for MS SQL?????In Bangladesh?????

1596