数据库sql Server2000 如何得到刚插入数据自动生成的ID?
请用存储过程!!!如何得到返回结果,是否跟接收Select语句一样?ALTERPROCEDUREdbo.G_Account_Add_123(@Account_DayTim...
请用存储过程!!! 如何得到返回结果,是否跟接收Select 语句一样?
ALTER PROCEDURE dbo.G_Account_Add_123
(
@Account_DayTime datetime,
@Account_Class varchar(50),
@Account_Over varchar(50),
@Remark varchar(5000)
--@Account_ID int output
)
AS
INSERT INTO Account
(Account_DayTime, Account_Class, Account_Over, Remark)
VALUES (@Account_DayTime, @Account_Class, @Account_Over, @Remark)
--set @Account_ID=(select Account_ID from inserted)
select @@identity
RETURN
这个正确吗? 展开
ALTER PROCEDURE dbo.G_Account_Add_123
(
@Account_DayTime datetime,
@Account_Class varchar(50),
@Account_Over varchar(50),
@Remark varchar(5000)
--@Account_ID int output
)
AS
INSERT INTO Account
(Account_DayTime, Account_Class, Account_Over, Remark)
VALUES (@Account_DayTime, @Account_Class, @Account_Over, @Remark)
--set @Account_ID=(select Account_ID from inserted)
select @@identity
RETURN
这个正确吗? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询