Output inserted.LastSequence into varchar(20) Update DailySequence set LastSequence=LastSequence+1 output inserted.LastSequence into where into DailySequence(SequenceDate) LastSequence int not null default(0) - Change the default if you want your first sequence to be 1 The following SQL provides you with a safe and performant means of getting the next available sequence number by simply executing the stored procedure from your server-side C# code and reading the value returned: create table DailySequence As such you're left with the database or the file system. In-memory isn't really an option since IIS resets its app pools every 29 hours by default, losing anything you may have cached. You're going to need to persist a sequence number somewhere so that you can safely increment it each time you've got a new file.
Licence key sequencher serial#
SET =(select CAST(CONCAT (, , AS represents the serial sequence that I lookup from "SetTblSrls" and I used to have a trigger on the target table to update this number on each insert by which i get a new number every time I generate the FileId Set = (SELECT FileNumSrl FROM SetTblSrls WHERE RecID = 1) Set = RIGHT('00' + CONVERT(NVARCHAR(2), DATEPART(DAY, GETDATE())), 2) I used to generate this number using SQL stored procedure like below, Set = (RIGHT(CONVERT(VARCHAR(8), GETDATE(), 1),2)) To protect from overposting attacks, please enable the specific properties you want to bind to, for This is my controller // POST: PatReg/Create DD is two digits of day, 001 is the serial start and reset every day.
"FileId" is my primary key and I want to generate it upon saving the record save it along with the record,Ĭustom number would have the following spec, YYMMDD0001 where YY is two digit of the year, MM Two digit of the month.