• Here is that function that I had mentioned in a previous post.....ughhh

    CREATE FUNCTION dbo.IsBigInt (@a varchar(30))

    returns bit

    AS

    BEGIN

    -- Submitted to SqlServerCentral by William Talada

    DECLARE

    @s-2 varchar(30),

    @i int,

    @IsNeg bit,

    @valid int

    -- assume the best

    SET @valid = 1

    SET @IsNeg=0

    SET @s-2 = ltrim(rtrim(@a))

    -- strip OFF negative sign

    IF len(@s) > 0

    AND LEFT(@s, 1) = '-'

    BEGIN

    SET @IsNeg=1

    SET @s-2 = RIGHT(@s, len(@s) - 1)

    END

    -- strip OFF positive sign

    IF len(@s) > 0

    AND LEFT(@s, 1) = '+'

    BEGIN

    SET @s-2 = RIGHT(@a, len(@a) - 1)

    END

    -- strip leading zeros

    while len(@s) > 1 and left(@s,1) = '0'

    set @s-2 = right(@s, len(@s) - 1)

    -- 19 digits max

    IF len(@s) > 19 SET @valid = 0

    -- the rest must be numbers only

    SET @i = len(@s)

    WHILE @i >= 1

    BEGIN

    IF charindex(substring(@s, @i, 1), '0123456789') = 0 SET @valid = 0

    SET @i = @i - 1

    END

    -- check range

    IF @valid = 1

    AND len(@s) = 19

    BEGIN

    IF @isNeg = 1 AND @s-2 > '9223372036854775808' SET @valid = 0

    IF @IsNeg = 0 AND @s-2 > '9223372036854775807' SET @valid = 0

    END

    RETURN @valid

    END