Feed on
Subscription

The field in how revising data to express with Sql statement,Realize Identity(100, 1)

Create Table Common_info(Name Varchar(10) , Value Int)Insert Into Common_info Values('msg_count' , 100)
Your Sql should so write (with memory process) : Create Proc P_ins_alm_msg
@msg_count Int OutAsSelect @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_countIf @@rowcount = 0Return -1000Insert Into Table1 (field0)Values(@msg_count)Return 0Go

Related:

收藏到网摘:

Submit: