SQL-Server Scripts


  1. Find Backup History.
  2. Find Restore History.
  3. Find CPU Usage in the last Hour
  4. Last ran query along with the time it was executed
  5. Currently running queries
  6. Top 50 High CPU Utilization Cached Plan
  7. longest running query using T-SQL
  8. Find database files location
  9. Find index fragmentation
  10. Find Memory Usage
  11. Finding who ran a DELETE STATEMENT.
  12. Finding the number of transactions per minute
  13. Object Level Permissions
    1. Script to find object level permissions on a database with Create definition.
    2. Script to find server level logins and roles assigned
    3. Script to find database users and roles assigned
    4. Script to find Object level permission for user databases
  14. Script to find Orphaned users in an entire Instance of SQL Server
  15. SQL INSTANCE AND VERSION
  16. FIND WAITS IN AN SQL INSTANCE
  17. BLOCKING

  18. View wait stats for all block processes on SQL Server