Hi All,
Is there a way to get alerts when any number sequence is running out of number or less than 10% or 20% left ? I have setup client's Production environment in LCS and there it tells me if any number sequence is running out and less than 20% left. But my client wants an email alert to be sent so that they don't have to check LCS diagnostic report regularly.
Please let me know if there is a standard configuration exists to achieve this functionality.
Thanks,
Baber.
*This post is locked for comments
Hi
We have set up e-mail notifications for our number sequences as a SQL Job.
It is running weekly, and I get an early heads-up for number sequences that have consumed at least 70% of their allocated range. I will post a blog entry later today about this, but here is the source code.
EXEC msdb.dbo.sp_send_dbmail @recipients = 'youremail@addr.ess', @subject = 'Number sequences consumed above threshold', @profile_name = 'SQLEMAILPROFILENAME', @attach_query_result_as_file=0, @query_attachment_filename = 'numberseq_PROD.csv', @query_result_separator = ';', @execute_query_database = 'YOURAXDATABASE', @query = 'SELECT [NUMBERSEQUENCE] ,[TXT] ,[LOWEST] ,[HIGHEST] ,[NEXTREC] FROM [YOURAXDATABASE].[dbo].[NUMBERSEQUENCETABLE] where (NEXTREC - LOWEST) >= (HIGHEST - LOWEST) * 0.7;', @query_result_header = 1, @exclude_query_output = 1, @query_result_width =500;
Thanks Ludwig.
Hello Barber,
I think the default is 9 numbers, which allows you creating more than 999 million transactions.
Should be sufficient for most companies :-)
Best regards,
Ludwig
Hi Ludwig,
Thanks for your suggestion. I will advise this. Not sure why the number sequence is setup to small limit like 5 digits initially. The maximum limit we can set is up to 10 digits, right ? Based on the maximum limit for an Integer.
Hello Baber,
Got your point.
Yet, I am wondering why you don't set the limit to a number that you won't reach in the next 10 years or so? Then you don't have to worry about alerts ;-)
Best regards,
Ludwig
Hi Ludwig,
I meant to say that the maximum limit for any number sequence is about to reach, then we need an alert that says, less than 20% numbers are left before it runs out. So that we can go and increase the limit. Hope you understand my point.
Thanks,
Baber.
Hello Baber,
Just wondering how number sequences can run out? Isn't it that once can assign up to 20 numbers in a sequence? What is the intention of the user if a number sequence comes to an end? Replace it with a new one?
Best regards,
Ludwig
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156