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

0 votes
Oct 11 in Database by Daric
• 500 points
45 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 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 darklord
• 6,190 points
101 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 darklord
• 6,190 points
58 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 in Database by Reshma
122 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 darklord
• 6,190 points
59 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
68 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 in Database by sampriti
• 1,100 points
54 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 in Database by Daric
• 500 points
30 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 in Database by Omaiz
• 560 points
41 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 in Database by Omaiz
• 560 points
69 views