Topic Sections
- Backup and Restore Scripts - examples of how to restore individual filegroups or files.
- CMDB Examples - a sample Configuration Management Database using SQL Server 2008's Central Management Server.
- Conversion Functions - convert dates, strings, numbers, etc.
- Current Activity - shows what's going on your server right now.
- Date Management Functions - functions to add/remove business days to a date.
- Developer Utilities - search for a string in database objects, list extended properties for objects.
- Error Management - set up Operators and Alerts to let you know when the server breaks
- Error Handling with TSQL - an intricate example of how to trap errors with SQL 2005.
- Execute T-SQL in Parallel - use CLR to execute T-SQL code across several databases at the same time.
- File Activity - find out which files are the most heavily accessed.
- Find Detached Databases - find detached mdf/ndf/ldf files sitting on your servers taking up space.
- Index Maintenance - defragmenting your indexes gets you free performance.
- Index Performance Tuning - find missing indexes, find unused indexes.
- Memory Performance Tuning - look at how SQL Server is using its memory.
- Procedure Cache Related Queries - check what queries have been running lately and why they've been slow.
- Policy Based Management Samples
- Size Calculations - calculate current table size, count rows in all tables, predict future table sizes, etc.
- SQL Server Agent Job Query Samples - query for failed SQL agent jobs, disable all jobs, sort all job steps alphabetically.
- String Manipulation Functions - replace substrings, word wrapping, trim patterns.
- Last clean DBCC CHECKDB date - find the last known clean copy of the database without corruption.
- Server Audit Examples in SQL Server 2008 - Introduction and sample scripts.
- Reporting Services Meta-data scripts - Introduction and sample scripts.
- The Object Within - Finding tables referenced in a stored procedure.
- Password Generation - query to create a random password of variable character length.
Jason Massie, Transact SQL Code Library Editor
Jason has 10 years experience as a DBA and has specialized in performance tuning for the last five. He was recognized by Microsoft as a SQL Server MVP. Jason has spoken at the Professional Association of SQL Server Conference, the North Texas SQL Server Users Group, SQL Connections and TechED. He has worked at Terremark (formerly Data Return) for nearly a decade.
His online presences include:
|