TAILIEUCHUNG - Hướng dẫn học Microsoft SQL Server 2008 part 59

Tạo User-Data Cột Một cột dữ liệu người dùng lưu trữ dữ liệu người dùng. Các cột này thường rơi vào hai loại: cột người dùng sử dụng để xác định một người, địa điểm, điều, sự kiện, hoặc hành động, và các cột có thêm mô tả người, địa điểm, điều, sự kiện, hoặc hành động. SQL Server bảng có thể có đến cột, nhưng được thiết kế tốt, cơ sở dữ liệu quan hệ bàn hiếm khi có nhiều hơn 25, và hầu hết chỉ có một số ít | Part IV Developing with SQL Server OrderlD UNIQUEIDENTIFIER NOT NULL FOREIGN KEY REFERENCES dbo. Order ON DELETE CASCADE ProductID UNIQUEIDENTIFIER NULL FOREIGN KEY REFERENCES r- r - Chapter 23 T-SQL Error Handling shows how to create triggers that handle custom ref-j 1 erential integrity and cascading deletes for nonstandard data schemas or cross-database referential integrity. Creating User-Data Columns A user-data column stores user data. These columns typically fall into two categories columns users use to identify a person place thing event or action and columns that further describe the person place thing event or action. SQL Server tables may have up to 1 024 columns but well-designed relational-database tables seldom have more than 25 and most have only a handful. Data columns are created during table creation by listing the columns as parameters to the CREATE TABLE command. The columns are listed within parentheses as column name data type and any column attributes such as constraints nullability or default value CREATE TABLE TableName ColumnName DATATYPE Attributes ColumnName DATATYPE Attributes Data columns can be added to existing tables using the ALTER TABLE ADD columnname command ALTER TABLE TableName ADD ColumnName DATATYPE Attributes An existing column may be modified with the ALTER TABLE ALTER COLUMN command ALTER TABLE TableName ALTER COLUMN ColumnName NEWDATATYPE Attributes To list the columns for the current database using code query the and catalog views. Column data types The column s data type serves two purposes 542 Creating the Physical Database Schema 20 It enforces the first level of data integrity. Character data won t be accepted into a datetime or numeric column. I have seen databases with every column set to nvarchar to ease data entry. What a waste. The data type is a valuable data-validation tool that should not be overlooked. It determines the amount of disk storage allocated

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.