Microsoft
70-433 · Question #54
You have a SQL Server 2008 database named Contoso with a table named Invoice. The primary key of the table is InvoiceId, and it is populated by using the identity property. The Invoice table is…
The correct answer is B. SET IDENTITY_INSERT Invoice ON. See the full explanation below for the reasoning.
Question
You have a SQL Server 2008 database named Contoso with a table named Invoice. The primary key of the table is InvoiceId, and it is populated by using the identity property. The Invoice table is related to the InvoiceLineItem table. You remove all constraints from the Invoice table during a data load to increase load speed. You notice that while the constraints were removed, a row with InvoiceId = 10 was removed from the database. You need to re-insert the row into the Invoice table with the same InvoiceId value. Which Transact-SQL statement should you use?
Options
- AINSERT INTO Invoice (InvoiceId, ... VALUES (10, ...
- BSET IDENTITY_INSERT Invoice ON;
- CALTER TABLE Invoice;
- DALTER DATABASE Contoso SET SINGLE_USER;
How the community answered
(40 responses)- A18% (7)
- B70% (28)
- C8% (3)
- D5% (2)
Community Discussion
No community discussion yet for this question.