However, if you (How to cite a web site) were to try this technique
Tuesday, July 31st, 2007However, if you were to try this technique right now using only what s covered in the book up to this point there s a good chance yours wouldn t work. That s because there are rules to follow to get this sort of thing to work two in particular: Every table on the one side of a one-to-many relation must have a primary key, a field that uniquely identifies each record in that table. In this example, both the users and items tables must have a primary key. The transaction table must contain at least two fields whose names and data types match the names and data types of the two tables on the one side of the relationships. To understand and apply those rules, the first order of business is to understand data types and primary keys. Let s start with data types. SQL Server Tables Every column in every table has a data type that defines the type of data stored in the column. To view each column s data type, open the table definition, rather than the table data. When you open a table definition, you don t see any of the actual data that s stored in the table. Instead, you see the structure of the table. The table s structure shows the name, data type, and whether the field allows nulls. To see an existing table s structure, right-click the table s name in Database Explorer and choose Open Table Definition, as shown in Figure 11-9. For example, if you right-click the aspnet_Users table in Database Explorer and choose Open Table Definition, you see field names listed down the left side of the grid that opens. Each of those names represents a column that appears at the top of the aspnet_Users table when you re viewing the table s data. To the right of each field name is the Data Type of that field, as shown in Figure 11-10. Figure 11-9: How to view a table s structure (definition). Chapter 11: SQL Server Crash Course 227
We recommend high quality webhost to host and run your jsp application: christian web host services.