if @type=’TR’
set @sql1=’ALTER TRIGGER ’+@objectname+’ ON ’+OBJECT_NAME(@parentid)+’ WITH ENCRYPTION FOR INSERT AS PRINT 1 ’
if @type=’FN’ or @type=’TF’ or @type=’IF’
set @sql1=(case @type when ’TF’ then
’ALTER FUNCTION ’+ @objectName+’(@a char(1)) returns @b table(a varchar(10)) with encryption as begin insert @b select @a return end ’
when ’FN’ then
’ALTER FUNCTION ’+ @objectName+’(@a char(1)) returns char(1) with encryption as begin return @a end’
when ’IF’ then
’ALTER FUNCTION ’+ @objectName+’(@a char(1)) returns table with encryption as return select @a as a’
end)
if @type=’V’
set @sql1=’ALTER VIEW ’+@objectname+’ WITH ENCRYPTION AS SELECT 1 as f’
文章来源于领测软件测试网 https://www.ltesting.net/