–209 新增短信类型
if(@type=‘Add_209’)
begin
if exists(select 0 from JC_ShortMessageType)
if exists(select 0 from JC_ShortMessageType where ShortMessageType = @ShortMessageType)
begin
print ‘已存在’
return
end
else
begin
insert into JC_ShortMessageType(ShortMessageTypeID,ShortMessageType,ShortMessageTime,StaffID,IsUserNum)
values((select top 1 (ShortMessageTypeID + 1) from JC_ShortMessageType order by ShortMessageTypeID desc),@ShortMessageType,(select convert(varchar,getdate(),120)),@StaffID,0)
select @@identity
return
end
else
begin
–短信类型表
insert into JC_ShortMessageType(ShortMessageTypeID,ShortMessageType,ShortMessageTime,StaffID,IsUserNum)
values(1,@ShortMessageType,(select convert(varchar,getdate(),120)),@StaffID,0)
select @@identity
end
end
SQL自己使用得比较顺手得ID自增
最新推荐文章于 2023-10-22 09:42:58 发布