sql - Retrieve the latest guid value that is testID -


this question has answer here:

goal:
retrieve latest guid value in real time after have inserted the value in table

problem:
don't know how it

info:
*you can add new vale address , zip code
*please take account can lots of data!

create table [addressbook] (     [testid] [uniqueidentifier] not null default newid(),     [address] [nvarchar](50) null,     [zipcode] [nvarchar](50) null ) 

you can retrieve inserted guid through insert stored procedure sample:

create procedure [dbo].[spupdatebookmark]     @bookmarkguid [uniqueidentifier] = null,     @otherfield nvarchar(256),     @newbookmarkguid [uniqueidentifier] output execute caller begin         set @bookmarkguid = newid()         insert bookmarks             (bookmarkguid,              otherfield)             values             (@bookmarkguid,              @otherfield)     set @newbookmarkguid = @bookmarkguid end 

then when call procedure add parameter output value.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -