Which two actions should you perform?

TestKing.com uses SQL Server 2005. You are implementing a series of views that are used in ad hoc queries. The views are used to enforce TestKing.coms security policy of abstracting data. Some of these views perform slowly. You create indexes on those views to increase performance, while still maintaining the company’s security policy. One of the views returns the current date as one of the columns. The view returns the current date by using the GETDATE() function. This view does not allow you to create an index. You need to create an index on the view. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

TestKing.com uses SQL Server 2005. You are implementing a series of views that are used in ad hoc queries. The views are used to enforce TestKing.coms security policy of abstracting data. Some of these views perform slowly. You create indexes on those views to increase performance, while still maintaining the company’s security policy. One of the views returns the current date as one of the columns. The view returns the current date by using the GETDATE() function. This view does not allow you to create an index. You need to create an index on the view. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.
Remove all deterministic function calls from within the view.

B.
Remove all nondeterministic function calls from within the view.

C.
Schema-bind all functions that are called from within the view.

D.
Create the view and specify the WITH CHECK OPTION clause.

Explanation:
The GETDATE() is a nondeterministic function, meaning that it does NOT have to return the same value every times it is called, and therefore the results of the function can not be indexed. When you specify the SCHEMABINDING option, you cannot drop any tables, views, or functions referenced by the view without first dropping the view.



Leave a Reply 0

Your email address will not be published. Required fields are marked *