Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server count all tables rows

CREATE TABLE #counts
(
    table_name varchar(255),
    row_count int
)

EXEC sp_MSForEachTable @command1='INSERT #counts (table_name, row_count) SELECT ''?'', COUNT(*) FROM ?'
SELECT table_name, row_count FROM #counts ORDER BY table_name, row_count DESC
DROP TABLE #counts
Comment

PREVIOUS NEXT
Code Example
Sql :: how to move a columns location in mysql 
Sql :: alter table change default 
Sql :: oracle add months to sysdate 
Sql :: mysql change data type of column 
Sql :: sql select except null 
Sql :: différence entre deux dates sql oracle 
Sql :: power query concatenate 
Sql :: select statement to print longest name 
Sql :: delete all table oracle 
Sql :: find most frequent value in sql column 
Sql :: sql server 2008 first and last day of month 
Sql :: remove transient options sql wordpress 
Sql :: how to get slow query log in mysql 
Sql :: mysql change primary key 
Sql :: compare date in sql 
Sql :: ora-00054 resource busy and acquire with nowait 
Sql :: psql client write to bash variable 
Sql :: oracle tablespace datafile max size 
Sql :: sql server select where date 
Sql :: sql server format datetime 
Sql :: how to reset table in sql server 
Sql :: oracle sysdate 
Sql :: mysql jdbc timezone 
Sql :: sql delete join 
Sql :: how to check xampp mysql password 
Sql :: postgresql update between 2 tables 
Sql :: postgresql today - 1 year 
Sql :: get only structure database mysql 
Sql :: mysql query bulk insert 
Sql :: update field sql 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =