TAILIEUCHUNG - Creating a Table

Creating a Table You can use Enterprise Manager to add a table to a database. In this section, you'll add a table to the Northwind database to store the details of a person | Creating a Table You can use Enterprise Manager to add a table to a database. In this section you ll add a table to the Northwind database to store the details of a person. This table will be called Persons and will contain the columns shown in Table . Table DEFINITION FOR THE COLUMNS OF THE Persons TABLE COLUMN NAME DATABASE TYPE LENGTH ALLOWS NULL VALUES PersonID int 4 No FirstName nvarchar 15 No LastName nvarchar 15 No DateOfBirth datetime 8 Yes Address nvarchar 50 Yes EmployerlD nchar 5 No To create a table in the Northwind database you select the Tables node of the Northwind database in Enterprise Manager and select Action New Table. You ll then see the table designer. Add the columns as shown in Table to the table as shown in Figure . Figure Adding a new table Note The length of some of the data types is fixed. For example the int type always uses 4 bytes of storage space so you can t change the length of an int column from 4. Similarly the datetime type always uses 8 bytes of storage space. You can change the length of nchar and nvarchar columns because those types are designed to store variable-length data. Click the Save button on the toolbar to save the table. In the Choose Name dialog enter Persons as the name and click OK to save your table as shown in Figure . Figure Entering the name of the table Note Once you ve saved your table you can return to the table designer at any time by selecting the table in the Tables node of Enterprise Manager right-clicking the table and selecting Design Table. In the rest of this chapter you ll learn how to Get additional information about the columns in a table using the Columns tab. Set the primary key of a table. Set the permissions that allow access to the contents of a table. Create a relationship between tables. Create an index to allow faster access to the information in a table. Create a constraint to restrict values that may be stored in a column. The Columns Tab In the area .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.