最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

编号规则用完警报/Alerts for Number sequence numbers running out

网络文摘 William 756浏览 0评论
we recently faced a problem where a number sequence reached its limit, although it was a bug in configuration and number sequence should be set to range like 9 digits 999,999,999, but this query below can be used to identify the number sequence which are reaching to its limit.  One can setup some alerts or some batch job that may be run on monthly basis and produce number sequences that are reaching consumption to let say 70%
 SELECT [NUMBERSEQUENCE]  
    ,[TXT]  
    ,[LOWEST]  
    ,[HIGHEST]  
    ,[NEXTREC]  
       ,100 * (NEXTREC - LOWEST)/(HIGHEST - LOWEST) as 'Percent Consumed'   
  FROM [dbo].[NUMBERSEQUENCETABLE]  
  where (NEXTREC - LOWEST) >= (HIGHEST - LOWEST) * 0.2  
 
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址