![]() Unfortunately, the SQL Server scalar type system doesn't have latitude and longitude data types. Angles such as latitude and longitude often contain four fields: degrees, minutes, seconds, and direction. Other multifield values can be scalars, too. You store a date in one column because even though it has three fields, it's a scalar value, and the SQL Server scalar data-type system provides the datetime data type to store it. In this case, the triple should use one column because storing a date in three columns makes no sense. ![]() Again, from experience, you know that storing a date in three columns would make it difficult to work with. You'd know from the experience of micro-parsing a field and from the rules of first normal form that the space you'd save squeezing each triple into one column would be a false economy. Given a sample set of data that contains the triples 12 4 9, 13 5 2, and 9 14 11, you might recognize each triple as an ordered collection of items known as a vector and decide that each triple needs three columns. SQL Server 2005 (formerly code-named Yukon) lets you use its new user-defined data type (UDT) capability to create your own multifield scalar data types and treat them the same way you do built-in scalar data types.įor example, imagine you have a table column that holds a scalar data type. However, a custom data type based on multiple fields-similar to SQL Server's built-in datetime multifield data type-might be useful. Instead of extending data types, you use SQL Server 2000's built-in constraints. You might wonder why you'd want to extend a data type such as int, and in SQL Server 2000, you wouldn't. When you extend a type, you add new types to it that let you work with more complex values. However, SQL Server 2000 doesn't provide a practical way to extend this type system. SQL Server 2000 has a scalar data-type system that defines data types such as int or float, which DBAs commonly think of as "primitives" because they contain values that you can't break down further into components.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |