Which action should you take?

You are a database developer on an instance of SQL Server 2008. Your Sales database contains current and historical sales information for your company.
The development team has recently created a user-defined table-valued function in .NET that accepts some input parameters and returns a list of customers ranked from highest to lowest based on their sales volume.
You have registered the assembly and issued the following statement:
CREATE FUNCTION dbo.GetRanked(@p1 int, @p2 char(5), @p varchar(20))
RETURNS TABLE (CustID int,CustName varchar(35),Volume money,Ranking int)
WITH EXECUTE AS CALLER AS EXTERNAL NAME MyAssembly.CLRFunctions.GetRankedList;
You use the result set returned by the function in many queries that include different values with the TOP keyword, and you want the queries to execute as quickly as possible.
Which action should you take?
A. Re-create the GetRanked function to include an ORDER clause.
B. Include the FAST query hint in each of your queries.
C. Re-create the GetRanked function to use EXECUTE AS SELF.
D. Create a Transact-SQL stored procedure that accepts a table-valued input parameter and inserts the values into another table, and create an index on the Ranking column of the table

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.