EnVisageOnline/Main/Database/Scripts/20150420/03_add_sd_constraint.sql

12 lines
326 B
Transact-SQL

use EnVisage
update ScenarioDetail set WeekEndingDate = null --these are index blockers, probably migrated from Projections
where WeekEndingDate = '1/1/1900'
go
CREATE UNIQUE NONCLUSTERED INDEX DF_Scenario_Detail_Unique
ON ScenarioDetail(ParentId, ExpenditureCategoryId, WeekEndingDate)
WHERE WeekEndingDate IS NOT NULL
GO