-- One-off (2026-10-12): every table of this project starts with CV_. -- Renames the results table created before that rule, and its two indexes, -- to the names tools/sql/create_tables.sql now uses. Run once in SSMS as a -- login allowed to alter the table (e.g. sa). Data, columns and the -- Windows login's read/write grant are kept. Safe to run again: each step -- only runs when the old name is still there. USE Charge_Validation; GO IF OBJECT_ID('dbo.ChargeSummary', 'U') IS NOT NULL AND OBJECT_ID('dbo.CV_ChargeSummary', 'U') IS NULL EXEC sp_rename 'dbo.ChargeSummary', 'CV_ChargeSummary'; GO IF EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('dbo.CV_ChargeSummary') AND name = 'IX_ChargeSummary_run_at') EXEC sp_rename 'dbo.CV_ChargeSummary.IX_ChargeSummary_run_at', 'IX_CV_ChargeSummary_run_at', 'INDEX'; GO IF EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('dbo.CV_ChargeSummary') AND name = 'IX_ChargeSummary_claim_no') EXEC sp_rename 'dbo.CV_ChargeSummary.IX_ChargeSummary_claim_no', 'IX_CV_ChargeSummary_claim_no', 'INDEX'; GO