Datasheet

When you mix the usage or assignment of variables or fields of different data types, a number of types
convert implicitly (or automatically). Most other types can be converted explicitly. (You say specifically
what type you want to convert to.) A few can’t be converted between at all. Figure 1-2 contains a chart
that shows the various possible conversions.
Figure 1-2
In short, data types in SQL Server perform much the same function that they do in other programming
environments. They help prevent programming bugs by ensuring that the data supplied is of the same
nature that the data is supposed to be (remember 1/1/1980 means something different as a date than as
a number) and ensures that the kind of operation performed is what you expect.
NULL Data
What if you have a row that doesn’t have any data for a particular column that is, what if you simply
don’t know the value? For example, let’s say that we have a record that is trying to store the company
performance information for a given year. Now, imagine that one of the fields is a percentage growth
14
Chapter 1
04_584340 ch01.qxp 10/18/06 2:11 PM Page 14