I do not want to pay any more money - so, this is not a duplicate.
A request has come down to restart using numbers after 30 days.
I am using AZURE SQL Server.
I have an integer field that is populated when a new record is created. This number, from the previous usage was an autoincrement integer, but, from the manager, this is getting confusing to the users to a see a number that keeps getting larger as they use the system.
So, the manager wants to see the number restart at one on the first of the month, and then increment from there, until the 1st of the month, then the number should start over at 1.
This resetting number is used as part of a concatenated string to generate a unique value, so i am not too worried about the repeating effect of using the same number.
My question is this - how in the world would this resetting be done? Azure does not really have a event scheduler 'thing' like a locally installed SQL Server does, and I only need it to run one time, where if two records are entered at 12:02AM only the first record would reset the number, the second would build from there.
My first guess was to use an insert trigger on the table, but this would require a large effort. my second thought was to have a next number table, but since it is a reactive type scenario, the number cannot be reset until AFTER midnight and on the first request.
any ideas would be greatly appreciated.