SQLpowered.comSQLpowered.com
Menu
  • SQL Server
  • T-SQL
  • DBA
  • Azure
  • BI
  • CI/CD
  • Scripts

Scripts

Backup & Restore
  • Create and restore database from database snapshot
Constraints
  • Drop all foreign keys in database
  • List duplicated foreign key relations
  • List Untrusted Foreign Keys for all Databases
Databases
  • Compress all tables and indexes in database
  • Drop all foreign keys in database (WHILE version)
  • Drop all schemas in database (WHILE version)
  • Drop all tables in database
  • Drop all tables in database (WHILE version)
  • Kill all sessions using database
  • Switch database to single user mode
Functions
  • Drop all functions in database
Indexes
  • Generate indexes REBUILD/REORGANIZE script based on fragmentation level
  • Missing indexes by average estimated impact
  • Rebuild all indexes on table
  • Rebuilding all indexes in database (cursor version)
  • Rebuilding all indexes in database and statistics update
Instance management
  • Get instance TCP port
  • Get Services and Service Accounts
Locks & Waits
  • Deadlock Chart from XE Ring Buffer
Metadata
  • Check for name of an object in all databases
  • Compressed Tables List
  • Generate UNION ALL views for all tables from all databases with the same schema
  • List Foreign Key Relations
  • List of all Columns with Default Constraint participating in Foreign Key
  • List of database tables with column names divided by comma
  • List of Tables with Columns, Data Types and Primary Key and Identity information
Performance
  • Batch Requests/sec
  • Flush plan cache for single database
  • Get adhoc query plans without reuse
  • Get CPU usage from Ring Buffer
  • Get I/O statistics for data and log files
  • Statistics overview with modifications, rows and age
  • Wait Statistics Overview
SSAS
  • Clear cube or dimesion cache
  • Closing SSAS connection
SSRS
  • List all data sources with connection string detail
  • List of all reports with last execution statistics
  • Reports execution history
  • View report parameters details
Stored Procedures
  • Drop all stored procedures in database
Synonyms
  • Drop all synonyms in database
Tables
  • Backup single table with timestamp
  • Drop all tables in database
  • List all Tables with IDENTITY column exists information
  • List of Tables with Number of Rows Including Data and Indexes Size
  • Reset IDENTITY_INSERT setting for session in case it is ON for unknown table
  • Reset IDENTITY_INSERT to OFF for all tables
Views
  • Drop all views in database
  • Refresh all views in database
  • SQL Server
  • T-SQL
  • DBA
  • Azure
  • BI
  • CI/CD
  • Scripts

@ SQLpowered.com 2020