Lin*_*net 7 sql auto-increment
我有这样的存储过程
create procedure onedata
as
begin
declare @input_data table (Id int NOT NULL AUTO_INCREMENT, name varchar(500) . .... )
insert into @input_data .....
....
end
Run Code Online (Sandbox Code Playgroud)
但我无法声明Id为AUTO_INCREMENT.它显示一些错误.
请提出一些解决方案.
提前致谢
pod*_*ska 20
这取决于您使用的各种SQL.
对于SQL Server
declare @input_data table (Id int NOT NULL identity(1,1), name varchar(50))
Run Code Online (Sandbox Code Playgroud)
从你的语法,我猜你正在使用SQL Server.如果是这样,请使用identity而不是auto_increment:
declare @input_data table (Id int primary key identity, ... )
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
29561 次 |
| 最近记录: |