Data Types
Choosing the right data type is an important step in creating efficient tables. If you choose the wrong data type for a column, your data integrity and system performance may suffer. The beginning of data integrity is the use of proper data types. Exceptional system performance depends on the right data types.
Consider a table used to track customer records for United States–based customers. Imagine that the DBA set the data type for the zip code column to char(50). Two major problems will exist because of this action. First, every record will consume 50 bytes for the zip code column alone (each record would consume 100 bytes if the nchar(50) data type were used). If the table has 200,000 records in it, the DBA has wasted a lot of ...
Get SQL Server® 2008 Administration: Real World Skills for MCITP Certification and Beyond now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.