1 DECLARE @baseSQL nvarchar(max),
5 SET @baseSQL = 'ALTER TABLE /*_*/oldimage 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('/*_*/oldimage')
14 AND c.name = 'oi_major_mime';--
16 SET @SQL = @baseSQL + @id;--
18 EXEC sp_executesql @SQL;--
21 FROM sys.check_constraints cc
23 ON c.object_id = cc.parent_object_id
24 AND c.column_id = cc.parent_column_id
26 cc.parent_object_id = OBJECT_ID('/*_*/oldimage')
27 AND c.name = 'oi_media_type';--
29 SET @SQL = @baseSQL + @id;--
31 EXEC sp_executesql @SQL;--
33 ALTER TABLE /*_*/oldimage ADD CONSTRAINT oi_major_mime_ckc check (oi_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart'));--
34 ALTER TABLE /*_*/oldimage ADD CONSTRAINT oi_media_type_ckc check (oi_media_type in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'));