开发者

How to get an Id of last inserted record in backend and display in flex

开发者 https://www.devze.com 2023-02-21 17:53 出处:网络
How to get an Id of last inserted record from backend and开发者_StackOverflow display the same with success message as \"RECORD INSERTED SUCCESSFULLY AS\" +Id in flex...

How to get an Id of last inserted record from backend and开发者_StackOverflow display the same with success message as "RECORD INSERTED SUCCESSFULLY AS" +Id in flex... am using Toad for sql server.......


If you are using SQL Server 2005 or 2008, use the function SCOPE_IDENTITY(), otherwise use the variable @@IDENTITY. For example, if you have a table with an auto-increment column id and a column value:

DECLARE @newid int
INSERT INTO mytable (value) VALUES 'x'
SET @newid = SCOPE_IDENTITY()
SELECT @newid
0

精彩评论

暂无评论...
验证码 换一张
取 消