Data type for a column with a decimal

  • I have a small table I am creating. I have a column that will hold a number (4.5). It will not be used to calculate anything. It is a versioning number. Is nchar or nvarchar the correct datatype to use here??? thank you in advance, as always!! :w00t:


    Thank you!!,

    Angelindiego

  • I still would use NUMERIC(?,1).

    Assume two version numbers: 10.1 and 4.1.

    Try to select the max. version number...

    DECLARE @tbl TABLE

    (

    num NUMERIC(4,1),

    stri VARCHAR(4)

    )

    INSERT INTO @tbl

    SELECT 4.1, '4.1' UNION ALL

    SELECT 10.1,'10.1'

    SELECT MAX(num) FROM @tbl

    SELECT MAX(stri) FROM @tbl



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • aaahhh.....good point!! Thank you!!! Numeric it is!!


    Thank you!!,

    Angelindiego

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

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