SQL Server Questions and Answers – Transaction – 1

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Transaction – 1”.

1. The INSERT, UPDATE, or DELETE statement fails if the OLE DB provider used to access the linked server does not support the _________ interface.
a) ITransJoin
b) ITransactionJoin
c) IactionJoin
d) None of the mentioned
View Answer

Answer: b
Explanation: ITransactionJoin is exposed only by providers that support distributed transactions.

2. Point out the correct statement.
a) Transaction ID Returns an object that can be used to specify configuration options for a subsequent call to ITransactionJoin
b) COMMIT WORK syntax, with or without specifying the optional keyword WORK, is compatible with SQL-92
c) You can use ROLLBACK WORK TRANSACTION to erase all data modifications made from the start of the transaction
d) SQL-92 was the third revision of the SQL database query language
View Answer

Answer: b
Explanation: SQL-92 was the third revision of the SQL database query language.

3. __________ marks the end of a successful implicit or explicit transaction.
a) COMMIT TRANSACTION
b) ROLLBACK TRANSACTION
c) COMMIT WORK
d) All of the mentioned
View Answer

Answer: a
Explanation: None.

4. What is the syntax for COMMIT WORK statement in transaction?
a)

advertisement
advertisement
COMMIT [ WORK ]
[ ; ]

b)

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
COMMIT WORK [ WORK ]
[ ; ]

c)

advertisement
COMMITWORK [ WORK ]
[ ; ]

d) None of the mentioned
View Answer

Answer: b
Explanation: COMMIT WORK marks the end of a transaction.

advertisement

5. Point out the wrong statement.
a) BEGIN TRANSACTION represents a point at which the data referenced by a connection is logically and physically consistent
b) BEGIN TRANSACTION deccrements @@TRANCOUNT by 2
c) BEGIN TRANSACTION starts a local transaction for the connection issuing the statement
d) All of the mentioned
View Answer

Answer: b
Explanation: BEGIN TRANSACTION increments @@TRANCOUNT by 1.

6. ____________ rolls back a user-specified transaction to the beginning of the transaction.
a) ROLLBACK
b) ROLLBACK WORK
c) SAVE TRANSACTION
d) COMMIT
View Answer

Answer: b
Explanation: When nesting transactions, ROLLBACK WORK always rolls back to the outermost BEGIN TRANSACTION statement.

7. Which of the following is valid syntax for SAVE TRANSACTION with all the optional parameters?
a)

SAVE { TRAN | TRANSACTION } 
[ ; ]

b)

SAVE  { savepoint_name | @savepoint_variable }
[ ; ]

c)

SAVE { TRAN | TRANSACTION } { savepoint_name | @savepoint_variable }

d) None of the mentioned
View Answer

Answer: c
Explanation: The savepoint defines a location to which a transaction can return if part of the transaction is conditionally canceled.

8. In _______ transaction we include the DML statements that need to be executed as a unit.
a) Explicit
b) Implicit
c) Distributed
d) All of the mentioned
View Answer

Answer: a
Explanation: Generally we don’t include Select statement in a transaction.

9. _________ permissions default to any valid user.
a) ROLLBACK WORK
b) ROLLBACK
c) COMMIT
d) None of the mentioned
View Answer

Answer: a
Explanation: When nesting transactions, ROLLBACK WORK always rolls back to the outermost BEGIN TRANSACTION statement and decrements the @@TRANCOUNT system function to 0.

10. If @@TRANCOUNT is 1 ________ makes all data modifications performed since the start of the transaction a permanent part of the database.
a) COMMIT TRANSACTION
b) SAVE TRANSACTION
c) ROLLBACK TRANSACTION
d) None of the mentioned
View Answer

Answer: a
Explanation: If @@TRANCOUNT is greater than 1, COMMIT TRANSACTION decrements @@TRANCOUNT only by 1 and the transaction stays active.

Sanfoundry Global Education & Learning Series – SQL Server.

To practice all areas of SQL Server, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.