|
-
May 5th, 2009, 12:40 PM
#1
Thread Starter
Addicted Member
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
-
May 5th, 2009, 01:13 PM
#2
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
-
May 5th, 2009, 03:17 PM
#3
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).
-
May 6th, 2009, 02:26 AM
#4
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|