Results 1 to 4 of 4

Thread: SQL Data Types

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Posts
    144

    SQL Data Types

    Hey all,

    I have a database that stores computer specs e.g.

    Hard Drive Size (GB)
    Memory Size (MB/GB)
    Graphics Card Size (MB)

    What i'm trying to do is query the database to find for example all hard drives under 80GB....

    How would i achieve this, is there a data type that understands the differences between K, KB, MB, GB, TB?

    Cheers

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: SQL Data Types

    I would store as an integer and store all in byte size. Do the conversion in the application on the way in for storage and when querying the data
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: SQL Data Types

    I agree with Gary, but rather than storing the amount of Bytes, store the smallest units you are interested in (which based on your example is MB).

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Posts
    144

    Re: SQL Data Types

    Cheers guys....It would be handy if there were a data type :P

Posting Permissions

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



Click Here to Expand Forum to Full Width