sqlserver备份存储过程
作者:互联网
创建备份用的表
if OBJECT_ID('bakuser_comments') is null
create table bakuser_comments(id bigint,name varchar(500),colid int,text varchar(max),objtime datetime,objexplain varchar(255))
执行备份,根据备份名称确定是否备份过
if not exists(select 1 from bakuser_comments where objexplain ='升级备份')
insert into bakuser_comments
(id,name,colid,text,objtime,objexplain)
select id,OBJECT_NAME(id),colid,text,getdate(),'升级备份'
from syscomments
where id=OBJECT_ID('存储过程名称')
标签:存储,bakuser,text,备份,OBJECT,sqlserver,comments,id 来源: https://www.cnblogs.com/cwfsoft/p/15587611.html