Author: Peter Whyte

  • DBA Scripts: SQL Server Migration Script Generators

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks. Moving a SQL Server workload to a new instance means recreating five things by hand, unless you script them: logins (with the same SIDs, or every restored database ends up with orphaned users), SQL Agent jobs, database user and role mappings, linked servers,…

  • DBA Scripts: Get OS and Hardware Info

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration › Server Inventory What Is This Server Actually Running On Before you can reason about performance, capacity, or whether a setting makes sense, you need the basics: how much CPU and memory the box actually has, what OS it’s running,…

  • DBA Scripts: Generate Restore With Move Script

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment › Migration Script Generators Generating RESTORE … WITH MOVE for a Migration With a Different Drive Layout Moving a SQL Server workload to a new instance where the target’s drive layout doesn’t match the source means every RESTORE DATABASE needs…

  • DBA Scripts: Generate Linked Server Script

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment › Migration Script Generators Recreating Linked Servers and Login Mappings for a Migration Moving a SQL Server workload to a new instance means recreating every linked server and its login mappings, unless you script it. This script produces sp_addlinkedserver and…

  • DBA Scripts: Generate User Mapping Script

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment › Migration Script Generators 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…

  • DBA Scripts: Generate Agent Job Script

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment › Migration Script Generators 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…

  • DBA Scripts: Generate Login Script

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment › Migration Script Generators 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…

  • DBA Scripts: SQL Agent and Jobs

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation A SQL Agent job that silently stopped running is one of the quietest failure modes in SQL Server, nothing errors, nothing alerts, the maintenance work it used to do just stops happening until someone notices the symptom weeks or months…

  • DBA Scripts: SQL Server Maintenance Job Framework

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation 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…

  • DBA Scripts: Generate Index Maintenance Jobs

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Maintenance Job Framework 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…