You work as a SQL Server 2012 database developer at ABC.com.
ABC.com has a database SalesDB with a large Orders table. You create a heap named OldData
that will store historical data from the Orders table.
You need to write a Transact-SQL query that will insert rows of data from the Orders table that are
marked as closed and are more than six months old.
Which of the following table hints should you use in your query if you want to optimize transaction
logging and locking for the query?
A.
You should make use of the READPAST hint.
B.
You should make use of the HOLDLOCK hint.
C.
You should make use of the READCOMMITTED hint.
D.
You should make use of the NOLOCK hint.
E.
You should make use of the TABLOCK hint.
F.
You should make use of the UPDLOCK hint.
Explanation:
what the explanation?
Explanation is in here.
https://msdn.microsoft.com/en-us/library/ms187373.aspx
When importing data into a heap by using the INSERT INTO SELECT FROM statement, you can enable optimized logging and locking for the statement by specifying the TABLOCK hint for the target table. In addition, the recovery model of the database must be set to simple or bulk-logged.