Skip to content

Instantly share code, notes, and snippets.

View faizalrf's full-sized avatar

Faisal Saeed faizalrf

View GitHub Profile
@faizalrf
faizalrf / get-rows-count-by-table-of-mysql-db.sql
Created February 1, 2023 09:11 — forked from koladilip/get-rows-count-by-table-of-mysql-db.sql
Get Rows counts from all the tables of MySQL DB
DELIMITER $$
CREATE PROCEDURE `COUNT_ROWS_COUNTS_BY_TABLE`(dbName varchar(128))
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE TNAME CHAR(255);
DECLARE table_names CURSOR for
SELECT CONCAT("`", TABLE_SCHEMA, "`.`", table_name, "`") FROM INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA = dbName;