You can monitoring TEMPDB usage using the following SQL statement.
The code below can be used to query the linked servers & the user assigned to it.
On the distribution database, you can execute the statement below to get the sizes of the internal replication specific tables
You can use the code below on your distributor in order to check the backlog of the replication
You can use the t-sql code to resume/suspend all databases from the always on group.
In SSMS you have the “schema changes history” report. You can have the same (or even more) details from T-SQL. You can use the t-sql statement below in order find schema changes the last day, in a particular database.
The T-SQL code below will give you an idea of the memory used by your reporting service. This query should be executed on the “reportserver ” database. Please be aware executing this statement can take some time.
Doing a dbcc checkdb can take a lot of time, and in case of corruption you really want to see the progress. You can use the t-sql statement below to find the progress. Keep in mind to replace the YOUR_DB_ID…
The code below will list the transactions on the instance, and it will also include the size of the log which is used for that transaction.The output is ordered by log size. You can also use the below to find…
You can use the default trace in SQL server in order to track CREATE/DELETE/ALTER DDL operations.The T-sql code below will show the CREATE/DELETE/ALTER DDL operations visible in the default trace.
Backups/restores can take a lot of time, but when it’s running, you want so see the progress.By executing the handy T-SQL code below, you can see the progress of the backups/restores on your system.
If you copy (backup/restore) a database from system A to system B, it is possible that the SQL users won’t be able login and this because the GUID/SID of the users on system A doesn’t match the GUID/SID of system…
Not all SQL scripts should be short 😉 The T-SQL code below will list the SQL Agent job history.
SQL server is of course caching data, in order to minimize access to disks. Sometimes you want to clear that memory, for testing purposes for example. You can use DBCC commands in order to clear the system / proc /…