Status: Reviewed (deep-dive v1)
Stack: PowerShell (build/version + Windows patch context) → SQL target matrix/procs → Blazor Server UI
Depends on: SQL-01 Inventory (instance population); coordinate windows with SQL-04 Agent / SQL-03 maint
Goal: Know every instance’s build vs target, plan CU/GDR/upgrade windows, and see who’s overdue — without turning this into a full upgrade project plan for every host.
Unpatched SQL is risk (security + known bugs). Blind patching without inventory, backups, and a window is also risk. This topic is currency + cadence, not step-by-step installer screenshots for every release.
| Field | Source |
|---|---|
| Current build | SERVERPROPERTY('ProductVersion'), ProductLevel, ProductUpdateLevel / registry / inventory collect |
| Target build | dbo.SqlBuildTarget (major.minor.build → target label) |
| Policy | e.g. “prod within 1 CU of current recommended” / “GDR within 30 days” |
Do not invent a mandatory target CU number in this doc — Rick sets the matrix; the system stores and flags drift.
CollectedAtRead-only. Collectors never launch setup.
| Table | Purpose |
|---|---|
dbo.SqlInstanceBuild |
Latest build facts (can live on SqlInstance) |
dbo.SqlBuildTarget |
Version family → target build / label / severity if behind |
dbo.SqlPatchHistory |
Recorded patch events (who/when/from→to/ticket) |
dbo.SqlPatchWindow |
Planned windows per instance/group |
Procs:
usp_SqlBuild_ApplySnapshotusp_SqlBuild_GetOutOfDate — Blazor overdue listusp_SqlBuild_GetInstanceDetailusp_SqlPatchHistory_Add — post-change loggingFlag rule (example): current build < target → Yellow; < target and older than policy days → Red; unknown target → Gray.
SqlPatchHistory + clear overdue on next collect | Change | Typical risk | Notes |
|---|---|---|
| GDR / security | Lower than major | Often faster path; still needs window |
| CU | Medium | Cumulative fixes; test nonprod first when possible |
| Major version upgrade | High | Compatibility level, deprecated features, duration — separate project checklist later |
| Edition upgrade | Medium/High | Licensing + feature enablement |
This deep-dive prioritizes CU/GDR currency. Major upgrades get a future dedicated note if Rick wants it.
| Symptom | Likely cause |
|---|---|
| Setup fails mid-way | Permissions; AV locks; disk space (SQL-06); pending reboot |
| Version unchanged after “success” | Patched wrong instance; named instance confusion |
| App breaks after CU | Plan/regression; compat; known issue — rollback decision |
| AG unhealthy post-patch | Wrong order; redo lag; need resume/sync time |
HA/DR awareness · Alerting & runbooks · (major upgrade playbook if needed)
SQL Dude — SQL-08 Patching & Upgrades v1