Get All the Tables with a Count of Their Records February 19, 2020 Get all the tables with a count of their records with the following query: CREATE TABLE #Temp ( TableName VARCHAR(MAX), Rows INT ); EXEC sp_MSForEachTable @command1 = ‘INSERT INTO #Temp(TableName,