MS SQL自定义函数IsPositiveInteger 判断字符串是否为正整数,0开始的的数字不算. SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[svf_IsPositiveInteger] ( @string NVARCHAR(MAX) ) RETURNS BIT --函数返BIT数据类型,是数字返回1,非数字返回0. AS BEGIN DECLARE @rtv BIT = 1 DECLA
1,自定义函数--返回单一值 CREATE FUNCTION [dbo].[Round2] ( -- Add the parameters for the function here @p1 sql_variant, -- decimal numbers @scale int ) RETURNS sql_variant AS BEGIN -- Declare the return variable here DECLARE @Result sql_variant,@interval sql_va