Which action should you take?

You are a database developer on an instance of SQL Server 2008. Your Employee table contains a HireDate column that contains the date each employee was employed with the company.
You have created the user-defined function shown in the exhibit to calculate the number days that an employee has been employed with your company:


You have some complex queries that use the dbo.udf_get_days_emp function to return a value. You want to optimize performance for these queries with the least amount of effort.
Which action should you take?
A. Remove the reference to the GETDATE() built-in function in the function’s definition.
B. Replace the function with a stored procedure that accepts an input variable and returns an output variable.
C. Create a view that includes only the function’s result and create an index on the view.
D. Create a computed column in the Employee table that uses the function in its expression definition, and create an index on the computed column.

microsoft-exams

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.