| begin
declare
@parent_obj varchar(255),@tr_parent_xtype varchar(10)
select
@parent_obj=parent_obj from sysobjects where id=object_id(@objectName)
select
@tr_parent_xtype=xtype from sysobjects where id=@parent_obj
if
@tr_parent_xtype=''''V''''
begin
set
@sql1=''''ALTER TRIGGER ''''+@objectname+'''' ON ''''+OBJECT_NAME(@parentid)+'''' WITH
ENCRYPTION INSTERD OF INSERT AS PRINT 1 ''''
end
else
begin
set
@sql1=''''ALTER TRIGGER ''''+@objectname+'''' ON ''''+OBJECT_NAME(@parentid)+'''' WITH
ENCRYPTION FOR INSERT AS PRINT 1 ''''
end
end
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''''
set
@q=len(@sql1)
set
@sql1=@sql1+REPLICATE(''''-'''',4000-@q)
select
@sql2=REPLICATE(''''-'''',8000)
set
@sql3=''''exec(@sql1''''
select
@colid=max(colid) from #temp 上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页 |