600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 如何用sql语句修改数据表中字段 实现identity(100 1)

如何用sql语句修改数据表中字段 实现identity(100 1)

时间:2021-09-02 06:21:56

相关推荐

如何用sql语句修改数据表中字段 实现identity(100 1)

如何用sql语句修改数据表中字段 实现identity(100,1),如何用sql语句修改数据表中字段,实现identity(100,1)

create table common_info(

name varchar(10),

value int)

insert into common_info values(msg_count, 100)

你的sql应该这么写(用存储过程):

create proc p_ins_alm_msg

@msg_countint out

as

select @msg_count = value from common_info where name = msg_count

update common_info set value = @msg_count+ 1 where name = msg_count and value =

@msg_count

if @@rowcount = 0

return -1000

insert into table1 (field0)

values(@msg_count)

return 0

go

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。