比如id= “abc0001”
我再添加一条数据,id=“abc0002”
如何实现用T-Sql
比如id= “abc0001”
我再添加一条数据,id=“abc0002”
如何实现用T-Sql
declare @ordernum as int
set @ordernum=
(
select max(ordernum)+1 from orders
)
写在存储过程中就行啦!去最大的然后加1不就可以了啊
int identity(1,1)
写触发器吧。 或者存储过程,然后在程序里调用。