开发者

How to get an Id of last inserted record in backend and display 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜