Searching for "dbo."

Q:

You are the database administrator for a financial services company. Employees enter data 24 hours a day into a SQL Server 2000 database. These employees report slower response times when new account information is gathered from branch offices and added to the database. You currently use the following BULK INSERT statement to add the account information.BULK INSERT finance.dbo.customersFROM 'd:bulkaccts143_10142000.txt'WITH DATAFILETYPE = 'char', FIELDTERMINATOR = 't', ROWTERMINATOR = 'n', TABLOCK You want to ensure that response times do not slow when new account information is added to the database. What should you do?

A) Add the BATCHSIZE option to the BULK INSERT statement, and then set the option equal to 10 percent of the number of rows to be loaded. B) Add the ROWS_PER_BATCH option to the BULK INSERT statement, and then set the option equal to 10 percent of the number of rows to be loaded.
C) Drop the indexes for the Customers table before the data load, and then re-create the indexes after the data load is complete. D) Remove the TABLOCK option from the BULK INSERT statement.
 
Answer & Explanation Answer: D) Remove the TABLOCK option from the BULK INSERT statement.

Explanation:

The TABLOCK hint increases the number of locks during the adding process. This is the reason why response time are slows down during this process. By removing the TABLOCK hint the default more granular row-level lock will be used. This would decrease the scope of the locks which would result in less waiting jobs and performance would improve.


Note: The BULK INSERT statement is used to copy a data file into a database table or view in a format specified by the user. The BULK INSERT statement accepts the TABLOCK hint, which allows the user to specify the locking behavior that the BULK INSERT statement should use. TABLOCK specifies that a bulk update table-level lock is taken for the duration of the bulk copy. If TABLOCK is not specified, the default uses row-level locks.

Report Error

View Answer Report Error Discuss

Q:

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an
application. The application connects to a Microsoft SQL Server 2008 database. The database includes a table named dbo.


Documents that contains a column with large binary dat a. You are creating the Data Access Layer (DAL). You add the following code segment to query the dbo.Documents table. (Line numbers are included for reference only.)


01public void LoadDocuments(DbConnection cnx)
02{
03var cmd = cnx.CreateCommand();
04cmd.CommandText = "SELECT * FROM dbo.Documents";
05...
06cnx.Open();
07
08ReadDocument(reader); }


You need to ensure that data can be read as a stream. Which code segment should you insert at line 07?

A) var reader = cmd.ExecuteReader(CommandBehavior.Default); B) var reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly);
C) var reader = cmd.ExecuteReader(CommandBehavior.KeyInfo); D) var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess);
 
Answer & Explanation Answer: D) var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess);

Explanation:
Report Error

View Answer Report Error Discuss