I want to use a new SEQUENCE each year (See here: 'Id' with the format: YYYYNNNNNN with the NNNNNN part restarting each year )
However you can not use
NEXT VALUE FOR inside a
CASE statement. Which normally makes sense. However I am hoping that I have a legit edge case.
Is there any way around this (which wouldn't need elevated permissions in prod)?
Perhaps with some indirection, wrapping each
NEXT VALUE FOR in some UDF and then call them in a
Or is that just crazy talk?