SQL Server Questions and Answers – DDL Triggers

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “DDL Triggers”.

1. _____________ is special type of trigger based on CLR environment.
a) DML
b) DDL
c) LOGON
d) CLR
View Answer

Answer: d
Explanation: CLR integration of triggers has been introduced with SQL Server 2008 and allows for triggers to be coded in one of .NET languages like C#, Visual Basic and F#.

2. Point out the correct statement.
a) Logon triggers are special type of trigger that fire when LOGON event of Sql Server is raised
b) DDL triggers are special type of trigger that fire when LOGON event of Sql Server is raised
c) DML triggers are special type of trigger that fire when LOGON event of Sql Server is raised
d) None of the mentioned
View Answer

Answer: a
Explanation: Logon event is raised when a user session is being established with Sql Server that is made after the authentication phase finishes.

3. DDL triggers can be applied to __________ statement.
a) CREATE
b) UPDATE
c) DELETE
d) INSERT
View Answer

Answer: a
Explanation: In SQL Server we can create triggers on DDL statements (like CREATE, ALTER, and DROP).
advertisement
advertisement

4. INSTEAD of clause cannot be used for ____________ trigger.
a) DML
b) DDL
c) LOGON
d) CLR
View Answer

Answer: b
Explanation: We can use only FOR/AFTER clause in DDL triggers not INSTEAD OF clause means we can make only After Trigger on DDL statements.

5. Point out the wrong statement.
a) DDL trigger can be used to observe and control actions performed on the server, and to audit these operations
b) DML trigger can be used to observe and control actions performed on the server, and to audit these operations
c) DDL triggers can be used to manage administrator tasks such as auditing and regulating database operations
d) None of the mentioned
View Answer

Answer: b
Explanation: DDL triggers are a special kind of trigger that fire in response to Data Definition Language (DDL) statements.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Purpose of DDL Trigger is to _____________
a) Perform administrative tasks
b) Audit
c) Regulating database operations
d) All of the mentioned
View Answer

Answer: d
Explanation: DDL triggers fire in response to a variety of Data Definition Language (DDL) events.

7. DDL triggers can only fire after the ______ statement has occurred.
a) DML
b) CLR
c) DDL
d) All of the mentioned
View Answer

Answer: c
Explanation: DDL Triggers can be set with either a Server scope or database scope.
advertisement

8. How many types of DDL Trigger is present in SQL Server?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: b
Explanation: Transact-SQL DDL Trigger and CLR DDL Trigger are two types of DDL Trigger.

9. ____________ triggers do not create the special inserted and deleted tables.
a) DML
b) CLR
c) DDL
d) All of the mentioned
View Answer

Answer: c
Explanation: DDL triggers do not fire in response to events that affect local or global temporary tables and stored procedures.
advertisement

10. Scope of DDL triggers in SQL Server can be _____________
a) Server
b) Client
c) Views
d) None of the mentioned
View Answer

Answer: a
Explanation: DDL triggers can be server-scoped or database-scoped. A database-scoped DDL trigger is simply called a database trigger.

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.