1 DECLARE @baseSQL nvarchar(max),
5 SET @baseSQL = 'ALTER TABLE /*_*/image 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('/*_*/image')
14 AND c.name = 'img_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('/*_*/image')
27 AND c.name = 'img_media_type';--
29 SET @SQL = @baseSQL + @id;--
31 EXEC sp_executesql @SQL;--
33 ALTER TABLE /*_*/image ADD CONSTRAINT img_major_mime_ckc check (img_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart'));--
34 ALTER TABLE /*_*/image ADD CONSTRAINT img_media_type_ckc check (img_media_type in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'));