Monday, March 19, 2012

Choosing Data Type

Hi ... I have question on datatype on SQL Server 2005 EE

What is a good data type for email, password, Phone Number and ISBN number?

Thanks!I'd use varchar for all of those.|||Thanks for the reply. How about phone number? isn't that suppose to beNumeric? Or Numeric just for something that is calculateable?|||

iloveny:

Thanks for the reply. How about phone number? isn't that suppose to beNumeric? Or Numeric just for something that is calculateable?


You've hit the nail on the head. Only use numeric data types for something that is calculateable. Phone numbers, ZIP codes, etc. should definitely be one of the string data types (I suggest varchar).

No comments:

Post a Comment