Query to list number of records in each table in a database

0 votes
Oct 11, 2019 in Database by Daric
• 500 points
71 views

1 answer to this question.

0 votes

Use the below code to list number of records in from the table

SELECT T.name AS [TABLE NAME], I.rows AS [ROWCOUNT] 
    FROM   sys.tables AS T 
       INNER JOIN sys.sysindexes AS I ON T.object_id = I.id 
       AND I.indid < 2 
ORDER  BY I.rows DESC
answered Oct 11, 2019 by Omaiz
• 560 points

Related Questions In Database

0 votes
1 answer

What are the ways to get the count of records in a table

To count the number of records in ...READ MORE

answered Sep 26, 2018 in Database by Sahiti
• 6,290 points
119 views
0 votes
1 answer

What do ‘Record’, ‘Field’ and ‘Table’ mean in terms of a database?

You can refer to the following definitions ...READ MORE

answered Nov 12, 2018 in Database by Sahiti
• 6,290 points
65 views
0 votes
1 answer

How to load data of .csv file in MySQL Database Table?

At first, put the dataset in the ...READ MORE

answered Jul 5, 2019 in Database by Reshma
202 views
0 votes
1 answer

Write a SQL query to find the names of employees that begin with ‘S’

To display the name of the employees ...READ MORE

answered Sep 26, 2018 in Database by Sahiti
• 6,290 points
66 views
0 votes
1 answer

What is a Join in terms of database?

JOINS are used to combine rows from ...READ MORE

answered Nov 13, 2018 in Database by DataKing99
• 8,130 points
82 views
0 votes
2 answers
0 votes
1 answer

Do I need to add primary key in each and every table?

Hi Shraddha, You have a doubt to add ...READ MORE

answered May 29, 2019 in Database by sampriti
• 1,100 points
63 views
0 votes
1 answer

How to check if a table exists in a given schema

Since you havent mentioned the DBMS in ...READ MORE

answered Oct 4, 2019 in Database by Daric
• 500 points
56 views
0 votes
1 answer

How to select the nth row in a SQL database table?

To select nth row type the below ...READ MORE

answered Sep 27, 2019 in Database by Omaiz
• 560 points
124 views
0 votes
1 answer

Which is the Preferred Method of Storing Passwords In Database?

Generally, we can use the sha hash ...READ MORE

answered Oct 11, 2019 in Database by Omaiz
• 560 points
99 views