Part of the DBA-Tools Project. Recreating Database Users, Roles, and Role Memberships for a Migration Moving a SQL Server workload to a new instance means recreating every database user, custom role, and role membership, unless you script it. This script loops over every online, writable user database on the source and produces, in order, ALTER…
Part of the DBA-Tools Project. Recreating Every SQL Agent Job for a Migration, in the Right Order Moving a SQL Server workload to a new instance means recreating every SQL Agent job, unless you script it, and getting the order wrong (steps before the job header, schedule before the start step) is exactly the kind…
Part of the DBA-Tools Project. SID-Preserving Login Recreation for a Migration Moving a SQL Server workload to a new instance means recreating every login, unless you script it, and doing it wrong means restored databases end up with orphaned users the moment a login’s SID doesn’t match the original database user’s SID. This script reads…
Part of the DBA-Tools Project, in the Maintenance and Automation area. If you’re already running Ola Hallengren’s maintenance solution, this framework won’t replace it, but the approach might still be useful: three small, readable T-SQL generator scripts that build the same category of scheduled job framework, full and log backups, backup cleanup, DBCC CHECKDB, index…
Part of the DBA-Tools Project. A Readable Generator for Index Rebuilds and Statistics Updates If you’re already running Ola Hallengren’s maintenance solution, this won’t replace it, but the approach here might still be useful: a small, readable T-SQL generator that builds an index maintenance job framework as plain sp_add_job / sp_add_jobstep DDL you can review…
Part of the DBA-Tools Project. A Readable Generator for Integrity Checks and msdb Housekeeping If you’re already running Ola Hallengren’s maintenance solution, this won’t replace it, but the approach here might still be useful: a small, readable T-SQL generator that builds a housekeeping job framework as plain sp_add_job / sp_add_jobstep DDL you can review line…
Part of the DBA-Tools Project. A Readable Generator for Full Backups, Log Backups, and Cleanup If you’re already running Ola Hallengren’s maintenance solution, this won’t replace it, but the approach here might still be useful: a small, readable T-SQL generator that builds a backup job framework as plain sp_add_job / sp_add_jobstep DDL you can review…
This post has been split into a pillar and five focused posts, each generator script now has its own page with its own real bugs, Example Output, and Related Scripts, rather than five topics crammed into one long post. Start at the hub: SQL Server Migration Script Generators All five scripts, the repo links, and…
This post has been split into a pillar and three focused posts, each generator script now has its own page with its own real bugs, Example Output, and Related Scripts, rather than three topics crammed into one long post. Start at the hub: SQL Server Maintenance Job Framework All three scripts, and the repo links,…
Part of the DBA-Tools Project. When Jobs Run, and Whether They’re Taking Longer to Do It SQL Agent Job Failure Summary tells you what broke. These two scripts answer two quieter but just as important questions: Get-JobScheduleSummary shows exactly when every enabled job is scheduled to run next, useful for spotting overlapping windows or confirming…
Always On Availability Groups (4) Auditing (7) Backups (5) Blocking Locking (6) Collectors (7) Database Backups & Recovery (8) Database Backups and Recovery (5) Database Maintenance (7) DBA Tools (24) Disk Space (5) Extended Events (8) Features (6) High Availability (6) Indexes (7) Installation (7) Instance (3) Inventory (6) Jobs (3) Maintenance (6) Migration (13) Monitoring (24) Performance (21) Performance Troubleshooting (9) PowerShell (4) Queries (3) Query Behaviour (5) Security (7) SQL Agent (5) SQL Scripts (17) SQL Server Administration (10) SQL Server Configuration (7) SQL Server Errors (5) SQL Server High Availability (4) SQL Server Internals (3) SQL Server Management Studio (SSMS) (6) SQL Server Monitoring (7) SQL Server Networking (9) SQL Server Security (7) Storage and Capacity (7) T-SQL (9) Temp DB (3) Tracing (7) Transaction Logs (4) Troubleshooting (14) Windows Server (4)