PrepAway - Latest Free Exam Questions & Answers

Tag: create table SQL 2008

Which statement should you use to create the trigger?

You are the database administrator for your company and manage all the SQL Server 2008
databases of the company. You are responsible for performing the daily backup activities on
all the databases on the server. Database users regularly create new objects in one of the
databases. You want to be notified when new objects are created in the database.
You want to create a trigger that will fire whenever a new user-defined function is created in
the database. The trigger should insert statement-specific data, such as the name of the
database user who issued the CREATE FUNCTION statement, the time the statement was
issued, and the Transact-SQL statement that was issued, into a database table named
Log_structures. The Log_structures table was created by using the following statement:
CREATE TABLE Log_structures ( user1 nvarchar(100), createtime datetime, SQL_stat nvarchar(2000) );
Which statement should you use to create the trigger?