sqlserver database, when adding data, insert the new id into another column

1 First determine the increment of self-increment, the default is 1.

2 Operation SQL:

insert into tb (ItemId,PathStr)
values (178,(select CONVERT(varchar(10),MAX(Id)+1)  from tb)

Guess you like

Origin blog.csdn.net/zhang123csdn/article/details/129184101