首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
You are the administrator of a SQL Server 2000 computer. The server contains a database named Customers, which is used by a cust
You are the administrator of a SQL Server 2000 computer. The server contains a database named Customers, which is used by a cust
admin
2009-05-19
9
问题
You are the administrator of a SQL Server 2000 computer. The server contains a database named Customers, which is used by a custom client/server application.
The database contains more than 1 million rows. Users report that the database responds slowly when they search for customers by using the application. Users search for customers by scrolling through an alphabetical list of customer names.
You use SQL profiles to capture information about how the application uses the database.
You receive results as shown in the following screen shot.
You need to improve the application’s performance. What should you do?
选项
A、Create additional nonclustered indexes on the CustomerInformation table.
B、Rewrite the application so that it uses a user-defined function to return the customer list.
C、Rewrite the application so that it uses a query with a WHERE clause to search for customer names.
D、Rewrite the application so that is uses a stored procedure to return the customer list.
答案
C
解析
Explanation: The WHERE clause of the SELECT statement causes the queries to be selective. Without the WHERE clause all records in the selected table is included in the result set. The WHERE clause tells SQL Server 2000 which data should be returned and thus limits the returned data to only that data that meets the condition set in the WHERE clause. This would improve the efficiency of the application.
Incorrect Answers:
A: Nonclustered indexes are useful for exact match queries because these indexes contain entries describing the exact location in the table of the data values being searched for. However, the application in this scenario does not make use of exact match queries.
B: Since functions only return a single value, not a recordset, they cannot be used in this scenario.
Note: In programming languages, functions are subroutines that are used to encapsulate frequently performed logic. Any code that must perform the logic incorporated in a function can call the function rather than having to repeat all of the function logic. In addition to built-in functions, SQL Server 2000 also allows us to define our own Transact-SQL functions using the CREATE FUNCTION statement. These user-defined functions can take zero or more input parameters, and can return a single value. Some user-defined functions can return a single, scalar data value or decimal value.
D: A stored procedure could be used but would not, by itself, improve any performance gain except that small gain of caching the execution plan.
Note: A stored procedure is a group of Transact-SQL statements tat are compiled into a single execution plan. SQL Server 2000 stored procedures return data as output parameters, which can return either data or a cursor variable; return codes, which are always an integer value; a result set for each SELECT statement contained in the stored procedure or any other stored procedures called by the stored procedure; or as a global cursor that can be referenced outside the stored procedure. They assist in achieving a consistent implementation of logic across applications.
The SQL statements and logic needed to perform a commonly performed task can be designed, coded, and tested once in a stored procedure. Each application needing to perform that task can then simply execute the stored procedure. Stored procedures can also improve performance.
转载请注明原文地址:https://kaotiyun.com/show/SuhZ777K
本试题收录于:
微软70228题库微软认证分类
0
微软70228
微软认证
相关试题推荐
AlmosteveryyearsincetheendofthefinancialcrisishasstartedwithrosyexpectationsamongAmericanforecasters,andthis
WhentheresidentsofBuenosAireswanttochangethepesostheydonottrustintothedollarstheydo,theygotoacueva,or"
EricHansenwritesabouttravelasaparticipatingenthusiastratherthanamereobserver.【T1】Itgivesthesenineessays,based
EricHansenwritesabouttravelasaparticipatingenthusiastratherthanamereobserver.【T1】Itgivesthesenineessays,based
EricHansenwritesabouttravelasaparticipatingenthusiastratherthanamereobserver.【T1】Itgivesthesenineessays,based
In2016,manyshoppersoptedtoavoidthefreneticcrowdsanddotheirholidayshoppingfromthecomfortoftheircomputer.But
Herearesomemanagementtoolsthatcanbeusedtohelpyouleadapurposefullife.1.UseYourResourcesWisely.Yourdecisi
Adealisadeal—except,apparently,whenEntergyisinvolved.Thecompany,amajorenergysupplierinNewEngland,provokedjus
Writealettertorecommendyourstudent,LiXu,forapositionofadministratorinacompany.Youshouldincludethedetailsyo
随机试题
纸芯式过滤器常用于过滤质量要求低的低压系统。()
当债券票面利率与市场利率一致时,则债券以__________发行。
A.窦神经冲动增加B.心交感神经冲动增多C.交感缩血管纤维冲动增多D.心迷走神经冲动增多E.交感舒血管纤维冲动增多体位性低血压恢复正常时,心率加快的原因是()
在我国,商业银行可以利用自由资金从事股票交易。()
“若顾客向你投诉,说你的下属服务质量差,你将会怎么做?”这属于()。(2008年5月二级真题)
下面是一位教师的反思日记:回顾以前,我感觉到,过去这一学期的教学比我前十年的教学总和都更让我明白什么叫教育。以前,我教好几个班,并且每班人数都在80左右。每天,我的大部分工作时间都在备课,与学生交流很少,我只考虑自己能提供什么,很少考虑学生需要什
中国汽车行业协会公布的2009年4月份中国汽车销售数据显示,在其他国家汽车销售量进一步疲软的情况下,国内乘用车销售量却持续上升,当月销量已达83.1万辆,比3月份增长7.59%,同比增长37.37%。乘用车细分为基本型乘用车(轿车)、多功能车(
赵某、钱某都是某公司的职员,两人同住一宿舍。2007年春,公司派赵某到珠海办事处工作1年。临行前,赵某将已使用了1年的一台电脑委托给钱某保管并允许其使用。1个月后,赵某给钱某写信说自己买了一台笔记本电脑,委托其保管的电脑可以适当价格出售,但modem因还有
Themeasureofaman’scharacteriswhathewoulddoifheknewhewouldneverbefoundout.
A、Therewastrafficjam.B、Thetrainsweredelayed.C、Hecouldn’tfindabusstop.D、Somethingwentwrongwithhisfriend’smoto
最新回复
(
0
)