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

Data table as parameter in sql server?

721


What do you understand by the data quality services in sql server?

691


Explain the stored procedure?

810


How many cores do I need for sql server 2016?

670


What are the differences between union, intersect, and minus operators?

761






What are functions in the sql server?

790


Why do you need a sql server?

685


How do you debug a procedure in sql server?

634


What is the recursive stored procedure in sql server?

705


How you can get the list of largest tables in a database?

688


How does a profiler work?

662


Equi join and non equi join is possible with sql server?

661


What is difference between stored procedure and user defined function?

727


Explain different backup plans?

702


Why is there a performance difference between two similar queries where one uses union and the other uses union all?

722