Đang chuẩn bị liên kết để tải về tài liệu:
The Real MTCS SQL Server 2008 Exam 70/432 Prep Kit- P165

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

The Real MTCS SQL Server 2008 Exam 70/432 Prep Kit- P165: Congratulations on your journey to become certified in SQL Server 2008. This book will help prepare you for your exam and give you a practical view of working with SQL Server 2008. | Self Test Appendix Appendix 125 because it is impossible to insert a duplicate value into a column marked as PRIMARY KEY. 10. You have created a Customers table and an NZCustomers view using the following definitions. CREATE TABLE Customers CustomerID int IDENTITY PRIMARY KEY CompanyName varchar 50 Country varchar 50 Notes varchar max GO CREATE VIEW NZCustomers AS SELECT FROM Customers WHERE Country New Zealand GO CREATE TRIGGER Trig_NZCustomers ON dbo.NZCustomers INSTEAD OF INSERT AS BEGIN SELECT CustomerID FROM INSERTED END GO You notice that when you insert data into the NZCustomers view no error occurs but the data does not appear in the table. What is the cause of the problem A. The Trig_NZCustomers must be dropped because it is preventing the insert operation. B. The view cannot be updated because of the WHERE clause. Remove the WHERE clause from the view. C. The IDENTITY column is preventing new CustomerlDs from being generated. Redefine the column not to use the IDENTITY attribute. D. You must explicitly call COMMIT TRANSACTION within Trig_ NZCustomers. Correct Answer Explanation A. Answer A is correct because the Trig_NZCustomers is defined as INSTEAD OF and therefore is preventing the insert operation. Incorrect Answers Explanations B C D. Answer B is incorrect because as long as the view is based on a single table it is updateable regardless of the WHERE clause. Answer C is incorrect because the IDENTITY column does 126 Appendix Self Test Appendix not stop update operations in any way. Answer D is incorrect because the transaction within the trigger commits automatically. 11. You are adding a Notes column to a table named Customers. You are instructed that the Notes column must always contain a value even if the value is No notes available. Unfortunately many stored procedures you use to add data to the Customers table omit the Notes column and it is impractical to redesign the stored procedures. What is the easiest way to ensure that the Notes column in