Search this site
Embedded Files
Skip to main content
Skip to navigation
Cool Tips
Backup and Restore
Backup - Backup all Databases with COPY_ONLY
Backup - Cleanup Symantec Backup Exec 10d History
Backup - Get Backup Compression Effectiveness
Backup - Get Backup File Size History
Backup - Get Database Autogrowth Events
Backup - Get Database File Sizes
Backup - Get Last Full Backup Date
Backup - Get Latest DB Restore Details
Backup - Get Restore Progress
Backup - Transfer a large DB across slow WAN
Backup: Get Database File Growth
Daily Backup Check
Get Database and Backup File Sizes
Retrieve Default Backup Location
Central Management Server
Central Management Server - Get List of Managed Servers
Clustering
Clustering - Cluster Failover Testing
Clustering - Cluster Troubleshooting
Clustering - Get Active Cluster Node
Clustering - Get Basic Cluster Information
Get Availability Group Details
Get Availability Group Secondaries
Managing SQL Agent Jobs in an Availability Group
Connectivity
Connectivity - Compare the Settings of 2 Connections
Connectivity - Kill all DB Connections
Connectivity - Unable to Connect - SQL Server or Network Problem?
Connectivity Capture Server Logon Events
Connectivity Get Connection Counts by IP and Login
Connectivity Get IP Address and Port for Current Instance
Data Conversion
Data Conversion - Check Impact of Converting from NVarchar to Varchar
Data Conversion - Convert Decimal to and from Roman Numerals
Data Conversion - Convert Decimal to Base n
Data Conversion - Convert GPS Decimal to Degree/Minute/Second (DMS) String
Data Conversion - Convert HEX to BIGINT
Data Conversion - Convert String to Proper Case
Data Conversion - Generate Numbers Table
Data Conversion - Generate Random Strings
Data Conversion - Get Distance Between 2 Lat/Long Coordinates
Data Conversion - Remove Selected Characters from a String
Data Conversion - Spell out Numbers
Data Conversion - Very Fast String Splitter
Data Conversion - Very Fast String Unsplitter (CSV String Creator)
Data Deduplication
Data Deduplication - Identify Items that are not Members of both Sets
Data Deduplication - Quick and Easy Deduping
Data Encryption
Data Encryption - Implement RC4 Encryption
Data Formatting
Data Formatting - Cleaning and Formatting Phone Numbers
Data Formatting - Dynamic Projection of Columns from a Query
Data Formatting - Enhanced String Trimmer
Data Formatting - Get List of Months or Days
Data Formatting - Output Query Results as HTML
Data Formatting - Quick and Dirty Results Graph
Data Formatting - Strip HTML Tags from a String
Data Formatting - Universal String Padder
Data Formatting Standardise PK and FK Names
Data Partitioning
Data Partitioning - Get Partition Details
Data Removal, Archiving and Structure
Data Archiving - Hierarchical Data Deletion
Data Archiving - Dynamically Create BCP Format File
Data Archiving - Generate Data Insert Scripts Using Hex Strings to Preserve Data
Data Archiving - Hierarchical Table Listing
Data Archiving/Removal/Strucutre - Move Data from Table to File and Replace with URI
Data Searching
Data Searching - Get nth Maximum Row
Data Searching - Search all Tables for a String
Data Searching - Search DB for all Code that References a Table
Data Type
Data Type - Convert all Database Objects to UNICODE
Data Type - Get Column Names and Data Types
Data Type - Check if a String is all Digits
Data Type - Comprehensive Collation Checker
Data Type - Get String Composition
Data Validation
Data Quality Services Management
Data Validation - Common REGEX Validation Expressions
Data Validation - Validate Canadian Postal Code
Data/Database Compression
Data/Database Compression - Compress all Tables and Indexes
Data/Database Compression - List Uncompressed Tables and Indexes
Data/Database Compression - Shrink DB Log File
Data/Database Size
Data/Database Size - Get Data and Log File Sizes
Data/Database Size - Get Database Size and Database Object Counts
Data/Database Size - Get Index Size and Counts
Database Code Objects (Stored Procedures, Functions and Views)
Get Database Code Object Metadata
Get SP Usage since last reboot
Database Mirroring
Database Mirroring - Create Mirroring Alerts
Database Mirroring - Generate Mirroring Setup Scripts
Database Setup
Database Setup - Moving Database File Location
Date and Time Manipulation
Date and Time - Create Master Calendar Table
Date and Time - Generating Sequential and Random Date Ranges
Date and Time - Calculate Common Date Ranges
Date and Time - Calculate Easter Sunday Date
Date and Time - Convert Milliseconds to Hours and Minutes String
Date and Time - Date Ceiling Function
Date and Time - Date Floor Function
Date and Time - Format Date as String
Date and Time - Get Fiscal Year Ordered Month List
Date and Time - Grouping/Counting by Date
Date and Time - Time Zone Storage and Conversion
Declarative Referential Integrity (DRI)
Declarative Referential Integrity - Get Foreign Key Columns
Declarative Referential Integrity - Get Primary Key Columns
Declarative Referential Integrity - Generate Commands to Create and Drop FKs
Declarative Referential Integrity - Generate Commands to Create and Drop PKs
Declarative Referential Integrity - Generate Commands to Enable/Disable FKs
Declarative Referential Integrity - Generate Commands to Enable/Disable Triggers
Declarative Referential Integrity - Show Column References
Get all Database DRI
Get Constraints Metadata
Get PK and FK Metadata
Dynamic Management View (DMV) Queries
DMV Queries - Get Blocking Locks
DMV Queries - Get Blocking/Blocked Processes
DMV Queries - Get Cached Plan Summary
DMV Queries - Get Comprehensive Running Requests Summary
DMV Queries - Get CPU Utilization for Last 30 Minutes
DMV Queries - Get Currently Running Processes
DMV Queries - Get Disk IO Stats (Detail)
DMV Queries - Get Top N Cache Read Queries on Server
DMV Queries - Get Top N Files With I/O Stall
DMV Queries - Get Top N Long Running Queries on Server
DMV Queries - Get Top N Objects Consuming Buffer Memory
DMV Queries - Get Top N Physical Disk Read Queries on Server
DMV Queries - General TempDB and Wait Stats
DMV Queries - Get Active Locks
DMV Queries - Get Average Data/Index Row Size
DMV Queries - Get Comprehensive Connection Summary
DMV Queries - Get Date/Time Table Last Accessed
DMV Queries - Get Disk IO Stats (Summary)
DMV Queries - Get DMV/DMF List
DMV Queries - Get Indication of TempDB Usage
DMV Queries - Get Poorly Utilized NonClustered Indexes
DMV Queries - Get Top N Cache Write Queries on Server
DMV Queries - Get Top N CPU Queries on Server
DMV Queries - Get Top SQL Server Waits
DMV Queries - Get Unused Indexes in a Database
DMV_Queries - Get Index Usage
File System
File System - Delete Files Older Than N Days
File System - Check if File Exists Using TSQL
File System - Create Sub-Folder from TSQL
Indexes
Get Fulltext Index Composition
Get Fulltext Index Status
Get Index Metadata
Indexes - Get Index Columns
Indexes - Check Whether Update Statistics Required
Indexes - Generate Comands to Create/Drop all Indexes in a Database
Indexes - Generate Commands to Create/Drop Recommended Missing Indexes
Indexes - Identify Full or Partial Duplicate Indexes
Indexes - Identify Top N Missing Indexes
List Manipulation
List Manipulation - Reorder Items in a List
MSDB, SQLAgent and Maintenance Plans
Maintenance Plan - Get Job Last Run Summary
Maintenance Plan - Get Job Run Detail
MSDB - Convert MSDB Job Duration to Seconds
MSDB - Convert MSDB Time to Time String
MSDB - List SQL Agent Jobs
MSDB - Turn on Job Logging to Table
MSDB - Convert MSDB Date and Time INTEGERS to DATETIME
MSDB - Convert MSDB Date to Date String
MSDB - Decode MSDB Job Frequency Interval
MSDB - Get MSDB Job Last Run Summary
MSDB - Get MSDB Job Run Details
SQL Agent - Get Progress of currently running SQL Agent jobs
Other Metadata Queries
Get Column Output List for Query
Get Database and Server Cross-References
Get Database Extended Properties
Get Power Management Settings
Get Queues and Rules Metadata
Get Referenced Object Hierarchy
Get SQL Server and Agent Uptime
Get SQL Server Version Information
Performance Measurement, Analysis and Optimization
Get Slow Running Queries
Performance - Search SQL Server Error Log Files
Performance - Get CPU Usage for Last 4 Hours
Performance - Get Database Buffer Cache Size
Performance - Get SQL Server Uptime (and SQLAgent Service Status)
Performance - Kill all Orphan Processes on a SQL Server
Performance - Kill all Processes in a Database
Performance - Manage and Retrieve Information from the Default Trace
Performance - SQL Server Profiler - Scheduled Server-Side Recording and Analysis
SQL Profiler Traces - Login Events only
SQL Profiler Traces - revised
Reports and SQL Server Reporting Services (SSRS)
Report and SSRS - Get Report Cache Policy
Report and SSRS - Get Report Execution Detail
Reports and SSRS - Get Report Data Sources Details (TSQL)
Reports and SSRS - Get Report Notifications Summary
Reports and SSRS - Get Report Roles by Report
Reports and SSRS - Get Report Schedules
Reports and SSRS - Get Report Subscriptions
Reports and SSRS - Get List of Report Folders
Reports and SSRS - Get Model Roles by Model
Reports and SSRS - Get Report as XML
Reports and SSRS - Get Report Data Sets
Reports and SSRS - Get Report Data Sources
Reports and SSRS - Get Report Data Sources Details (Stored Procedures)
Reports and SSRS - Get Report Execution Summary
Reports and SSRS - Get Report Object Creation and Change Dates
Reports and SSRS - Get Report Parameter List
Reports and SSRS - Get Report Snapshot History
Scripting SQL Server
Auto-Create Call SP TSQL Templates
Auto-Create Insert Into Table TSQL Templates
Auto-Create Select from Table TSQL Templates
Auto-Create Select from TVF TSQL Templates
Auto-Create Update each Table TSQL Templates
Expand all TABs in a String to Spaces
Generate a descriptive list of SQL Agent jobs
Pivoting Rows into Columns
SQL Server DBA/Developer Interview Questions
SQL Server Migration Toolkit
Generate Backup Scripts
Generate Database Offline-Online Scripts
Generate Restore Scripts
Get Replication Details
Get Unused Databases
Migrate all logins and Database Security
Migrate Backup Files
Relocating System Databases
Remove Permissions from a Database
SQL Server Security
Change SQL Agent Job Owner
Create Application Roles using TSQL
Enumerate Logins mapped via Groups
Fix Orphaned Users in a Database
Generate a database security report
Generate Script for Database Permissions
Get List of Failed Login Attempts
Get List of Impersonated Rights
Get List of Users with 'sa' Priveleges
Server Permissions Audit
Stored Procedures, Functions and Views
String Manipulation
String Manipulation - Extract Parts of URL String
String Manipulation Get Count of Number of Occurrences of Character in String
String Manipulation - Add Leading Zeros to String
String Manipulation - Alternate String Splitter
String Manipulation - Alternate String Splitter (XML)
String Manipulation - Extract Parts of an IPv4 Address
String Manipulation - Get Nth Item From a Delimited String List
String Manipulation - Get Occurences of Character in String
Tables and Triggers
Get Columns Updated by Trigger
Get Table Metadata
Get Table Metadata (2)
Get Trigger Metadata
Stored Procedures, Functions and Views
*** UNDER CONSTRUCTION ***
Google Sites
Report abuse
Page details
Page updated
Google Sites
Report abuse