Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sQL query to get all table records count from a database

DECLARE @TableRowCounts TABLE ([TableName] VARCHAR(128), [RowCount] INT) ;
INSERT INTO @TableRowCounts ([TableName], [RowCount])
EXEC sp_MSforeachtable 'SELECT ''?'' [TableName], COUNT(*) [RowCount] FROM ?' ;
SELECT [TableName], [RowCount]
FROM @TableRowCounts
ORDER BY [TableName]
GO
Comment

PREVIOUS NEXT
Code Example
Sql :: create table like sql 
Sql :: get all db sizes in mysql server 
Sql :: mysql last year 
Sql :: sql server date format dd/mm/yyyy 
Sql :: How to reset forgotten postgresql password 
Sql :: update all rows mysql 
Sql :: oracle last day of month 
Sql :: tsql cmd exec script from file 
Sql :: how to alter length character varying postgres 
Sql :: mysql remote connection command line 
Sql :: wordpress print query sql 
Sql :: select amount weeks between two dates mysql 
Sql :: start postgres server 
Sql :: t sql get foreign key 
Sql :: grant all privileges mysql 
Sql :: postgres alter table owner 
Sql :: sql group by year 
Sql :: sql order by ascending 
Sql :: insert data in pgsql 
Sql :: how to use lower case in mysql 
Sql :: sql offset 
Sql :: float precision in psql 
Sql :: mysql change auto_increment start value 
Sql :: (PDOException(code: 2002): SQLSTATE[HY000] [2002] Permission denied at 
Sql :: SHOW COLUMNS Statement 
Sql :: trouver doublons sql 
Sql :: postgres float to int 
Sql :: declare variables sql 
Sql :: oracle nextval 
Sql :: recently updated stored procedure in sql server 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =