sql返回行id
时间:2014-05-09 13:32:10
收藏:0
阅读:294
1、sql语句中
insert into tableName() output
inserted.id values()
2 、存储过程中
ALTER
PROCEDURE
dbo.getBuyMedicID
(
@id int output,
@AllsumMoney
money
)
AS
begin
INSERT INTO
t_buyMedic(sumMoney,buyDate)
VALUES(@AllsumMoney,getdate())
select
@id=@@identity
end
RETURN
评论(0)