1 DECLARE @baseSQL nvarchar(max),
5 SET @baseSQL = 'ALTER TABLE /*_*/uploadstash 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('/*_*/uploadstash')
14 AND c.name = 'us_media_type';--
16 SET @SQL = @baseSQL + @id;--
18 EXEC sp_executesql @SQL;--
20 ALTER TABLE /*_*/uploadstash ADD CONSTRAINT us_media_type_ckc check (us_media_type in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'));