sql server中判断整数

it2026-05-18  9

代码 CREATE   FUNCTION   [ dbo ] . [ FunIsInteger ]  (     @strs   varchar ( 50 )) RETURNS   bit AS BEGIN      declare   @rb   bit    if   patindex ( ' %-% ' , @strs ) <> 0   set   @strs   =   right ( @strs , len ( @strs ) - 1 )     if   patindex ( ' %[^0-9]% ' , @strs ) = 0   and   isnumeric ( @strs ) = 1          set   @rb   =   1      else          set   @rb   =   0      return   @rb END

这个函数可以判断是否为整数。

转载于:https://www.cnblogs.com/lfzwenzhu/archive/2010/05/17/1737304.html

相关资源:postgresql中判断是否为数字和是否为时间日期格式的相关函数
最新回复(0)