你打算从SQL Server 2000数据库的客户表和国别表中导入客户数据到SQL Server 2005数据库中。你要确保在导入过程中,客户表中国家代码列的每个值在SQL Server 2005数据库中国别表内都有其相应的纪录。你在两个表之间定义一外键,这样,参照完整性将保证若国家代码值在客户表中存在,而在国别表中不存在时导入程序失败。你要确保国别表无记录时导入过程不失败,该怎么做?()
A.删除外键,用脚本导入数据,重新创建外键 B.创建一个CHECK约束 C.创建一个DML INSTEAD OF触发器,将错误记录写入文件或表中 D.创建一个DML AFTER触发器,将错误纪录写入文件或表中
单项选择题You are planning to import customer data from the Customer table and the Country table in your SQL Server 2000 database into a SQL Server 2005 database. You want to ensure that during the import process,each value in the CountryCode column of the Customer table has a corresponding record in the CountryCode column in the Country table of the SQL Server 2005 database. You define a foreign key between these two tables. Thus,referential integrity will guarantee that the import routine fails if there are any records where a CountryCode value does not exist in the Country table but does exist in the Customer table. You need to ensure that the import process does not fail if records are encountered that do not exist in the Country table. What should you do?()
A.Drop the foreign key. Import the data by using the script. Re-create the foreign key. B.Create a CHECK constraint. C.Create a DML INSTEAD OF trigger that writes the failed records to a file or table. D.Create a DML AFTER trigger that writes the failed records to a file or table.
单项选择题You work with a SQL Server 2005 database that provides banking information for customers. You want customers to see banking reports that combine data that is retrieved from the database with real-time investment information that comes from a Web service provided by a third party. The investment information must be current when the reports are executed. You need to create the appropriate objects that support the reports. What should you do?()
A.Publish the data in the database as an XML Web service by using the FOR XML AUTO clause. B.Create a table to store the banking information for each customer. Create a trigger that fires when data is inserted into the table that joins with the data coming from the Web service. C.Create a Transact-SQL stored procedure that uses a temporary table to store the banking information for each customer. Update the table with the values from the Web service. D.Have a developer in TestKing.com create an assembly that calls the remote Web service.Create a CLR function by using the assembly. Call the CLR function and combine the results with banking information in the database.
多项选择题TestKing.com has a SQL Server 2005 computer. You have been assigned the task of retrieving information about a user who is currently logged in. You need to create a function that returns scalar information about the activity time for a particular user. What are two possible ways to achieve this goal?()
A.Create a function that returns a list of values that represent the login times for the given user. B.Create a function that returns a list of values that represent the people who have logged more hours than the current user has logged. C.Create a function that returns a numeric value that represents the number of hours that a user has logged for the current day. D.Create a function that returns a numeric value that represents the number of hours that a user has logged for the current month.
单项选择题You are responsible for managing the database schema for an order entry application in a SQL Server 2005 database. After a design review, a member of the development staff asks you to add a new column named CommissionRate to the Product table. Because the actual commission rates for all products are not known at this time, each product has a default commission rate of 12 percent. The rate can be modified as necessary. You add the new column. You need to configure the table to assign the default value as efficiently as possible. What should you do?()
A.Create an INSERT trigger to assign the default value to each item in the table. B.Create a CHECK constraint to validate the data and to assign the default value to each item in the table. C.Create an UPDATE trigger to update the default value for each new item in the table. D.Create a DEFAULT constraint to assign the default value specifying the WITH VALUES argument.
单项选择题销售部和财务部在两栋不同的楼里。两个部门由一个2兆位的网络连接。并且都使用SQLServer2005。销售部在一个名为DB1的数据库里记录所有的销售事务。DB1包含380张表,大小为10GB。财务部为做报表可以只读方式访问DB1里的4张表。财务部会全天进行查询并需要尽可能最新的数据。财务部的用户告诉你报表执行非常缓慢。为优化网络容量,你的部门决定为财务部提供此四张表的副本。现在,你需要提供这些表的副本。因此,你想用一种占最小网络带宽的复制法达成此目标,该怎样做?()
A.将DB1镜像到财务部,以高有效性模式配置镜像 B.建立DB1的每日事务日志传输到财务部 C.建立每日快照复制到财务部,定义一个只包含这四张表的发布 D.建立事务复制到财务部,定义一个只包含此四张表的发布