1 DECLARE @baseSQL nvarchar(max),
5 SET @baseSQL = 'ALTER TABLE /*_*/categorylinks DROP CONSTRAINT ';--
8 FROM sys.check_constraints cc
10 ON c.object_id = cc.parent_object_id
11 AND c.column_id = cc.parent_column_id
13 cc.parent_object_id = OBJECT_ID('/*_*/categorylinks')
14 AND c.name = 'cl_type';--
16 SET @SQL = @baseSQL + @id;--
18 EXEC sp_executesql @SQL;--
20 ALTER TABLE /*_*/categorylinks ADD CONSTRAINT cl_type_ckc CHECK (cl_type IN('page', 'subcat', 'file'));