sp_MSForEachTable Example T-SQL Code to Count all Rows in all Tables in MS SQL Server Database

sp_MSForEachTable Example T-SQL Code to Count all Rows in all Tables in MS SQL Server Database

瀏覽:933
日期:2024-08-13
As you can see, I altered the sp_MSForEachTable command to an INSERT statement instead of a SELECT statement. This will insert the row count for all tables in a SQL database into the RowCount table. As a last step, we can execute the below t-sql SELECT .....看更多