Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002

    Question Doubt in Data Type. Please Help

    I am currently allotting data types to attributes. I would like know the usage of Float visa vis Decimal. Say I have got a field whose maximum holding capacity is Decimal(11,3) which the data may ocassionaly reach. Is it advisable to have float istead of Decimal. Will float have any overhead/benifits in terms of performance and storage. Float, I find is not commonly used in commercial applications.

    Is there any overhead on Varchar as an Primary Key.

    Please advise me the earliest.

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    from your description, you probably don't want to use float

    it is an approximation only, and requires conversion

    varchar has a very small overhead as compared to a fixed character field, but this is more than offset by the savings in space required


  3. #3
    Join Date
    Feb 2003


    I would recommend trying to identify a numeric field for your primary key.

    From the SQL Server 2000 training course ... "A Primary Key should be a
    numeric value if possible, but this is not a hard and fast rule."

    I believe this is because character searches will perform slower than numeric searches.

    As for the Decimal vs Float ... from books online ...
    "Because of the approximate nature of the float and real data types, do not use these data types when exact numeric behavior is required, such as in financial applications, in operations involving rounding, or in equality checks. Instead, use the integer, decimal, money, or smallmoney data types."

    So it all depends on what the purpose of the field is. What data are you storing in the numeric field?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts