TAILIEUCHUNG - Microsoft SQL Server 2008 R2 Unleashed- P81

Microsoft SQL Server 2008 R2 Unleashed- P81:SQL Server 2005 provided a number of significant new features and enhancements over what was available in SQL Server 2000. This is not too surprising considering there was a five-year gap between these major SQL Server 2008 is not as much of a quantum leap forward from SQL Server 2005 | 744 CHAPTER 24 Creating and Managing Tables the AdventureWorks2008 database was added to the diagram and a new Printer table was added as well. The printer table was added by right-clicking in the diagram design window and selecting the New Table option. FIGURE Using database diagrams to create a table. The column names and related attributes for the new Printer table in Figure were added using the table entry fields. The data entry screen for the table is similar to the one provided with the Object Explorer. You enter column names along with their associated data types and nullability option. The advantage of database diagrams is that you can define relationships and show them with a visual representation. This visual view provides a much easier way to view the table structures in a database. In the example shown in Figure the line drawn between the Department and Printer tables represents a relationship between these two tables. You define such a foreign key relationship in the database diagram by dragging the related column from one table to the other related table. Table relationships and constraints are discussed later in this chapter in the section Defining Table Constraints. Using T-SQL to Create Tables Ultimately all the tables created with the visual tools can also be created by using T-SQL. As with many of the SSMS tools database objects can be resolved or scripted into T-SQL statements. Let s examine the T-SQL syntax to better understand some of the table creation options then we can discuss the definition of the columns in each table. Download from Creating Tables 745 The full T-SQL CREATE TABLE syntax is extensive. It includes options to define table constraints indexes and index options. SQL Server Books Online shows the full syntax and describes each of these options in detail. Listing shows the basic T-SQL syntax the first part of the syntax is listed in Books Online. This syntax is enough to enable you to create

TỪ KHÓA LIÊN QUAN
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.