begin
select @colid=max(colid) from #temp where number=@k
set @n=1
while @n<=@colid
begin
select @OrigSpText1=ctext,@encrypted=encrypted,@status=status FROM #temp WHERE colid=@n and number=@k
SET @OrigSpText3=(SELECT ctext FROM syscomments WHERE id=object_id(@objectName) and colid=@n and number=@k)
if @n=1
begin
if @type=’P’
SET @OrigSpText2=(case when @number>1 then ’CREATE PROCEDURE ’+ @objectName +’;’+rtrim(@k)+’ WITH ENCRYPTION AS ’
else ’CREATE PROCEDURE ’+ @objectName +’ WITH ENCRYPTION AS ’
end)
if @type=’FN’ or @type=’TF’ or @type=’IF’--刚才有错改一下
SET @OrigSpText2=(case @type when ’TF’ then
’CREATE FUNCTION ’+ @objectName+’(@a char(1)) returns @b table(a varchar
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/