PCS Infotech Placement: Sample Questions 15 - 16 of 25

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 15

Edit

Statement

True-False▾

A trigger name can have the same name as that of its base table name

Answer

TRUE

Explanation

  • Trigger name must be unique with respect to other triggers in the same schema.
  • Need not be unique with respect to other schema objects, table, and subprograms.
  • For eg. , a table and a trigger can have the same name.
  • Trigger doesn՚t share the same namespace as table.
  • Functions, procedures, table etc. share the same namespace.

Question 16

Edit

Statement

True-False▾

DDL can be used in trigger

Answer

TRUE

Explanation

Understanding of DDL Triggers
  • DDL triggers fire in response to a variety of Data Defination Language events.
  • The events primarily correspond to Transact-SQL statement- CREATE, ALTER, DROP, GRANT, DENY, REVOKE or UPDATE statistics.
  • Used to perform administrative task and enforce business rules.
  • Apply to all commands of a single type on a database or a server.

Types of DDL Trigger:

  • Transact-SQL DDL Trigger:
    • Stored procedure that execute one or more SQL statements in response to a server-scoped event.
    • A DDL Trigger fires if a statement such as ALTER SERVER CONFIGURATION is executed.
  • CLR DDL Trigger:
    • Executes one or more methods written in managed code with members created in the . NET framework.
Types of DDL Trigger
  • Fires only after the DDL statements that trigger are run.
  • DDL triggers cannot use “INSTEAD OF” triggers.
  • Create the special inserted and deleted table.
  • Multiple triggers created for each event.

Developed by: