You have an SQL query that takes one minute to execute. You use the following code segment to execute the SQL query asynchronously.Dim ar As IAsyncResult = cmd.BeginExecuteReader( )You need to execute a method named DoWork( ) that takes one second to run

题目

You have an SQL query that takes one minute to execute. You use the following code segment to execute the SQL query asynchronously.Dim ar As IAsyncResult = cmd.BeginExecuteReader( )You need to execute a method named DoWork( ) that takes one second to run while the SQL query is executing. DoWork( ) must run as many times as possible while the SQL query is executing. Which code segment should you use?()

  • A、While ar.AsyncWaitHandle Is Nothing DoWork()End Whiledr = cmd.EndExecuteReader(ar)
  • B、While Not ar.IsCompleted DoWork()End Whiledr = cmd.EndExecuteReader(ar)
  • C、While T hread.CurrentThread.ThreadState = ThreadState.Running DoWork()End Whiledr = cmd.EndExecuteReader(ar)
  • D、While Not ar.AsyncWaitHandle.WaitOne() DoWork()End Whiledr = cmd.EndExecuteReader(ar)

相似考题
更多“You have an SQL query that takes”相关问题
  • 第1题:

    You have applications that have frequently executed queries, and produce small and static result sets.You configure the sqlnet.ora file in the client machine to set a nonzero value for the OCI_RESULT_CACHE_MAX_SIZE parameter. What is the purpose of this configuration?()

    • A、to avoid round trips to the server by enabling caching of query results in client memory
    • B、to improve performance by storing a copy of the data from the private SQL area of the PGA
    • C、to enhance the query performance by creating a cache in the client memory for sorting operations
    • D、to avoid the storing of query plans and results in the server by creating a cache in the client memory

    正确答案:A

  • 第2题:

    You are a database administrator for your company. The company uses a vendor company’s application that is based on a proprietary database. You query data from the application database and import the data into a SQL Server 2005 database. The application vendor provides you with a new OLE DB driver to be used when querying the application database. Company policy prohibits connections between the SQL Server database and the application database, except when querying this data. You need to provide a way to query data from the application database. What should you?()

    • A、Configure a Linked Server connection to the application database.
    • B、Write a query that uses an OPENDATASOURCE command.
    • C、Write a query that uses an OPENQUERY command.
    • D、Configure a Remote Server connection to the application database.

    正确答案:B

  • 第3题:

    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. The instance has databases for a finance application and a manufacturing application. You want to put some limitation on the maximum CPU query time allowed by the applications, so you configure the Resource Governor to achieve this. But you notice that certain reports do not execute successfully any longer on the manufacturing application. You have to allow the manufacturing application to consume more CPU time, so you have to change the Resource Governor configuration.  Which Resource Governor component should you configure?()  

    • A、The workload group which is used by default 
    • B、The workload group which is used by the finance application 
    • C、The classifier function which identifies the finance application 
    • D、The workload group which is used by the manufacturing application 

    正确答案:D

  • 第4题:

    You are a professional level SQL Server 2005 database administrator in an international corporation named Wiikigo. You are experienced in implementing high-availability solutions, monitoring the database server, and design deployment. In the company, you major job is the deployment, maintenance and support of Microsoft SQL Server 2005.You work as a database administrator for your company. You find a problem that when the following query is executed, a SQL Server 2005 application will perform slowly. SELECT * FROM Orders WHERE OrderStatus = ’InProgress’ This query is executed by the application as an ad hoc query. In most occasions, this query performs much more quickly. The company has the OrderStatus column indexed. The value InProgress is included by only a small number of the rows. Nevertheless, the OrderStatus column index which is the most ideal for this query is not being utilized. The performance of this query should be enhanced. However, the application that executes the query should not be changed. In addition, the effect on end users should be cut to the least.  Which action should be performed to finish the task?()

    • A、To finish the task, the index should be built by utilizing a FILLFACTOR of 10 percent.
    • B、To finish the task, the index should be recreated to have all of the columns in the table included.
    • C、To finish the task, an indexed view of the Orders table should be viewed.
    • D、To finish the task, the statistics should be updated on the index.

    正确答案:D

  • 第5题:

    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. A user reports that when he runs a query, it takes a quite long time and it is still unfinished. As the IT support, you have to verify whether the query is blocked.  Which tool should you use? () 

    • A、You should use the Database Engine Tuning Advisor tool 
    • B、You should use the Windows System Monitor tool 
    • C、You should use the Job Activity Monitor tool in Microsoft SQL Server Management Studio 
    • D、You should use the Activity Monitor tool in Microsoft SQL Server Management Studio

    正确答案:D

  • 第6题:

    You work in a company which uses SQL Server 2008. You are the administrator of the company database. In your company there is a server which contains a default SQL Server 2005 instance. For a new application, you have to install a SQL Server 2008 instance on the server. Your company CIO assigns a task to you. You must make sure that the respective certified third-party applications have access to both database instances. You have to achieve this goal without changing the existing application environments. So what should you do to achieve this by using as little database administrative effort as possible?()

    • A、You should install SQL Server 2008 as a named instance, and make the new application to use the new instance. 
    • B、You should install SQL Server 2008 as the default instance, and make the new application to use the default instance. 
    • C、You should upgrade the SQL Server 2005 application to use SQL Server 2008. 
    • D、You should upgrade the SQL Server 2005 instance to a SQL Server 2008 instance. 

    正确答案:A

  • 第7题:

    单选题
    A new report process containing a complex query is written, with high impact on the database. You wantto collect basic statistics about query, such as the level of parallelism, total database time, and the number of I/O requests. For the database instance STATISTICS_LEVEL, the initialization parameter is set to TYPICAL and theCONTROL_MANAGEMENT_PACK_ACCESS parameter is set to DIAGNOSTIC+TUNING. What should you do to accomplish this task?()
    A

    Execute the query and view Active Session History (ASH) for information about the query.

    B

    Enable SQL trace for the query.

    C

    Create a database operation, execute the query, and use the DBMS_SQL_MONITOR. REPORT_SQL_MONITOR function to view the report.

    D

    Use the DBMS_APPLICATION_INFO.SET_SESSION_LONGOPS procedure to monitor query execution and view the information from the V$SESSION_LONGOPS view.


    正确答案: B
    解析: 暂无解析

  • 第8题:

    单选题
    You have an SQL query that takes one minute to execute. You use the following code segment to execute the SQL query asynchronously.IAsyncResult ar = cmd.BeginExecuteReader( );You need to execute a method named Do Work( ) that takes one second to run while the SQL query is executing. DoWork( ) must run as many times as possible while the SQL query is executing. Which code segment should you use? ()
    A

    while(ar.AsyncWaitHandle==null){DoWork();}dr=cmd.EndExecuteReader(ar);

    B

    while(!ar.IsCompleted){DoWork();}dr=cmd.EndExecuteReader(ar);

    C

    while(Thread.CurrentThread.ThreadState==ThreadState.Running){DoWork();}dr=cmd.EndExecuteReader(ar);

    D

    while(!ar.AsyncWaitHandle.WaitOne()){DoWork();}dr=cmd.EndExecuteReader(ar);


    正确答案: A
    解析: 暂无解析

  • 第9题:

    单选题
    You are creating an online catalog application that will display product information on the company Web site. The product data is stored in a SQL Server 2005 database. The data is stored as relational data but must be passed to the application as an XML document by using FOR XML. You test your application and notice that not all of the items matching your query appear in the XML document. Only those products that have values for all elements in the schema appear.   You need to modify your Transact-SQL statement so that all products matching your query appear in the XML document. What should you do?()
    A

    Add an XML index to the table that contains the product data.

    B

    Add the XSINIL argument to the ELEMENTS directive in the query.

    C

    Add a HAVING clause to the query.

    D

    Add the replace value of clause to the query.


    正确答案: B
    解析: 暂无解析

  • 第10题:

    单选题
    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There are queries that have an estimated execution cost less than 3. You intend to configure the instance, make it use a single thread for these queries. In the options below, which sp_configure configuration option should you set?()
    A

    You should set query governor cost limit

    B

    You should set cost threshold for parallelism

    C

    You should set priority boost 

    D

    You should set precompute rank


    正确答案: B
    解析: 暂无解析

  • 第11题:

    单选题
    You need to resolve the blocking issue that is affecting the performance of the CRM system. What should you do?()
    A

    Replace the named query with an SQL view.

    B

    Set the transaction isolation level to serializable in the named query.

    C

    Set the source database to use snapshot isolation.

    D

    Set the transaction isolation level to repeatable read in the named query.


    正确答案: C
    解析: 暂无解析

  • 第12题:

    单选题
    By mistake, you ran the batch job (for updating the BILL_DETAILS table) twice. You are not sure which rows in the BILL_DETAILS table were affected. You need to identify:  a) a list of changes made along with the transaction identifier of each change  b) the necessary SQL statements to undo the erroneous changes  Which option would you choose?()
    A

    RMAN only

    B

    Flashback Table only

    C

    Flashback Versions Query only

    D

    Flashback Database and Flashback Transaction Query

    E

    Flashback Versions Query and Flashback Transaction Query


    正确答案: D
    解析: 暂无解析

  • 第13题:

    You define a multiple-row subquery in the WHERE clause of an SQL query with a comparison operator "=".What happens when the main query is executed?()

    • A、The main query executes with the first value returned by the subquery.
    • B、The main query executes with the last value returned by the subquery.
    • C、The main query executes with all the values returned by the subquery.
    • D、The main query fails because the multiple-row subquery cannot be used with the comparison operator.
    • E、You cannot define a multiple-row subquery in the WHERE clause of a SQL query.

    正确答案:D

  • 第14题:

    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There are queries that have an estimated execution cost less than 3. You intend to configure the instance, make it use a single thread for these queries. In the options below, which sp_configure configuration option should you set?()

    • A、You should set query governor cost limit
    • B、You should set cost threshold for parallelism
    • C、You should set priority boost 
    • D、You should set precompute rank

    正确答案:B

  • 第15题:

    TestKing.com has multiple servers in a distributed environment. You work with two SQL Server 2005 computers named SQL1 and SQL2. Each server uses SQL Server Authentication and they use different logins.You need to write a distributed query that joins the data on SQL1 with the data on SQL2. What should you do?()

    • A、Ensure that both SQL1 and SQL2 use the same login name as the security context for each server.
    • B、Configure SQL2 as a remote server. Write the query on SQL1.
    • C、Configure SQL2 as a linked server to impersonate the remote login.
    • D、Configure SQL2 as a distributed server. Use pass-through authentication.

    正确答案:C

  • 第16题:

    You have a DNS server named Server1 that runs Windows Server 2003 Service Pack 2 (SP2). You create a primary zone on Server1 for contoso.com.You run the DNS simple query test and recursive query test. The simple query test completes successfully, but the recursive query test fails.You need to ensure that the recursive query test can complete successfully.  What should you do on Server1?()

    • A、Clear the cache.
    • B、Disable recursion.
    • C、Enable access to the Internet.
    • D、Configure a reverse lookup zone.

    正确答案:C

  • 第17题:

    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance which contains a database. Now your company CIO assigns a task to you. You have to check the performance of the SQL Server 2008 instance. You have to find out which common language runtime (CLR) queries takes the longest-running time.  So in the options below, which dynamic management view should you choose to use?()  

    • A、sys.dm_os_wait_stats 
    • B、sys.dm_exec_requests 
    • C、sys.dm_exec_sessions 
    • D、sys.dm_exec_query_stats

    正确答案:D

  • 第18题:

    单选题
    You received complaints about the degradation of SQL query performance. You identified top SQL queries that consume time. What would be your next step to find out recommendations about statistics collection and restructuring of the SQL statement to improve query performance?()
    A

    run Segment Advisor

    B

    run SQL Tuning Advisor on top SQL statements

    C

    run the Automatic Workload Repository (AWR) report

    D

    run the Automatic Database Diagnostic Monitor (ADDM)on top SQL statements


    正确答案: D
    解析: 暂无解析

  • 第19题:

    单选题
    You are a professional level SQL Server 2005 database administrator in an international corporation named Wiikigo. You are experienced in implementing high-availability solutions, monitoring the database server, and design deployment. In the company, you major job is the deployment, maintenance and support of Microsoft SQL Server 2005. You work as a database administrator for your company. A vendor company’s application is utilized, and the application is based on a proprietary database. Data is queried from the application database and the data is imported into a SQL Server 2005 database. A new OLE DB driver is offered by the application vendor, and the new OLE DB driver will be utilized when the application database is queried. According the company requirements, the connections between the SQL Server database and the application database is prohibited, except when this data is queried. You should think out a method to have data queried from the application database.  Which action should be performed to achieve the goal?()
    A

    To achieve the goal, a Linked Server connection should be configured to the application database.

    B

    To achieve the goal, a query should be written, and an OPENQUERY command is utilized by the query.

    C

    To achieve the goal, a Remote Server connection to the application database should be configured.

    D

    To achieve the goal, a query should be written, and an OPENDATASOURCE command is utilized by the query.


    正确答案: B
    解析: 暂无解析

  • 第20题:

    单选题
    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. A user reports that when he runs a query, it takes a quite long time and it is still unfinished. As the IT support, you have to verify whether the query is blocked.  Which tool should you use? ()
    A

    You should use the Database Engine Tuning Advisor tool 

    B

    You should use the Windows System Monitor tool 

    C

    You should use the Job Activity Monitor tool in Microsoft SQL Server Management Studio 

    D

    You should use the Activity Monitor tool in Microsoft SQL Server Management Studio


    正确答案: D
    解析: 暂无解析

  • 第21题:

    单选题
    You define a multiple-row subquery in the WHERE clause of an SQL query with a comparison operator "=".What happens when the main query is executed?()
    A

    The main query executes with the first value returned by the subquery.

    B

    The main query executes with the last value returned by the subquery.

    C

    The main query executes with all the values returned by the subquery.

    D

    The main query fails because the multiple-row subquery cannot be used with the comparison operator.

    E

    You cannot define a multiple-row subquery in the WHERE clause of a SQL query.


    正确答案: D
    解析: 暂无解析

  • 第22题:

    单选题
    You have applications that have frequently executed queries, and produce small and static result sets.You configure the sqlnet.ora file in the client machine to set a nonzero value for the OCI_RESULT_CACHE_MAX_SIZE parameter. What is the purpose of this configuration?()
    A

    to avoid round trips to the server by enabling caching of query results in client memory

    B

    to improve performance by storing a copy of the data from the private SQL area of the PGA

    C

    to enhance the query performance by creating a cache in the client memory for sorting operations

    D

    to avoid the storing of query plans and results in the server by creating a cache in the client memory


    正确答案: D
    解析: 暂无解析

  • 第23题:

    单选题
    Your application must access data that is located on two SQL Server 2005 computers. One of these servers is named SQL1 and the other is SQL2. You have permissions to create a stored procedure on SQL1 to support your application. However,on SQL2 you only have permissions to select data. You write the stored procedure on SQL1. The stored procedure accesses SQL2 by using the OPENQUERY Transact-SQL statement. However,the query fails when executed.You need to troubleshoot the cause of the error. What should you do?()
    A

    Join the two servers by using the four-part syntax of server.database.schema.table.

    B

    Reference SQL2 by using an alias.

    C

    Add SQL2 as a remote server to SQL1.

    D

    Add SQL2 as a linked server to SQL1.


    正确答案: C
    解析: 暂无解析

  • 第24题:

    单选题
    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. The instance has databases for a finance application and a manufacturing application. You want to put some limitation on the maximum CPU query time allowed by the applications, so you configure the Resource Governor to achieve this. But you notice that certain reports do not execute successfully any longer on the manufacturing application. You have to allow the manufacturing application to consume more CPU time, so you have to change the Resource Governor configuration.  Which Resource Governor component should you configure?()
    A

    The workload group which is used by default 

    B

    The workload group which is used by the finance application 

    C

    The classifier function which identifies the finance application 

    D

    The workload group which is used by the manufacturing application 


    正确答案: D
    解析: 暂无解析