Max value for datatype

  • Hello guys,

    Is it possible to know which is the max value for a datatype? but making a query... Of course this dont result, but something like this Select MAX(Money)...

    Best Regards

  • Not sure if this is what you are looking for.

    The only thing I could think of is(keep in mind if the data type is not assign to a value the return will be null):

    DECLARE @bigint as bigint

    DECLARE @int as int

    DECLARE @smallint as smallint

    DECLARE @tinyint as tinyint

    SET @bigint = 1

    SET @int = 1

    SET @smallint = 1

    SET @tinyint = 1

    SELECT @bigint,length = DATALENGTH(@bigint)

    SELECT @int,length = DATALENGTH(@int)

    SELECT @smallint,length = DATALENGTH(@smallint)

    SELECT @tinyint,length = DATALENGTH(@tinyint)

  • Thanks for answer,

    As i can see on the link u send, no one knows how to specifies the maxium values for various numeric datatypes, i know that int is 2147483647 but where can i find, the max value for Money for example?

    And then i create one function where i store that information...

    Thanks Again

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply