If you want to get the size of each table in each database on the instance, run the following script – Below part of the
Tag: SQL Scripts
Script to Check SQL Server Database Connections
More significant for Azure SQL Database to determine who all are connected from which IP address and how many connections sys.dm_exec_sessions and sys.dm_exec_connections
SQL Script to Check Most Time Taking Queries at Instance Level
This is similar to what we saw in SQL Script to Check Most Executed Queries in a SQL Server Database post with the difference that
SQL Script to Check Most Executed Queries in a SQL Server Database
sys.dm_exec_query_stats sys.dm_exec_sql_text to fetch the exact query sys.dm_exec_query_plan to fetch the query plan And again Thanks to Glenn Berry for sharing the script.
Script to Check Unused or Possibly Bad NonClustered Indexes in SQL Server Database
sys.indexes, sys.objects and sys.dm_db_index_usage_stats Checks where writes are greater than the reads i.e. index maintenance is higher than the benefit it is serving during read
Script to Check Row Count for All Tables in SQL Server
sys.partitions and sys.objects Consider ONLY Heap or Clustered Index that gives you the count Thanks to Glenn Berry for sharing the script.
Script to Check Statistics Updated Last Time in SQL Server
When was the last time statstics were updated for a particular index You can filter it as per you needs to run it faster or
Script to Check Index Fragmentation in SQL Server
This may take some time to get executed if the database size is large You may filter it for some specific cases to run it