.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> Sql Server >> Post New Question Subscribe to Interview Questions

What is a trigger?

Posted By :nishithraj     Posted Date :December 24, 2009    Points :10   Category :Sql Server 
Triggers are basically used to implement business rules. Triggers is also similar to stored procedures. The difference is that it can be activated when data is added or edited or deleted from a table in a database

You can also find related Interview Question to What is a trigger?  below: 

What is a trigger?

  
Triggers are basically used to implement business rules. Triggers is also similar to stored procedures. The difference is that it can be activated when data is added or edited or deleted from a table in a database. (More...)

Can we generate Trigger for two table and give a example ?

  
yes,we can create trigger on two tables.

CREATE TABLE T4 (a INTEGER, b CHAR(10))

CREATE TABLE T5 (c CHAR(10), d INTEGER)

CREATE TRIGGER trig1
AFTER INSERT ON T4
REFERENCING NEW AS newRow
FOR EACH ROW
WHEN (newRow.a <= 10)
BEGIN
INSERT INTO T5 VALUES(:newRow.b, :newRow.a);
END trig1
(More...)

How will you create a DML Trigger?

  
The procedure to create a DML trigger is :

CREATE TRIGGER (TRIGGER_NAME)
ON (TABLE_NAME)
AFTER (INSERT OR UPDATE OR DELETE)
AS
PRINT 'THIS IS DOTNETSPARK'
GO
(More...)

Database: State whether Trigger is a stored procedure or not?

  
.Yes, It is a Stored procedure that initiates an action when an event occurs. (More...)

Database: State whether a trigger can be called or executed?

  
.No, It is called by DBMS automatically whenever any changes are made to the associated table. (More...)

Database: Define trigger?

  
It is a Stored procedure that initiates an action when an event occurs. Event can be insert, delete or update. (More...)

Database: Difference between stored procedure and trigger?

  
.Stored procedure are called explicitly where as trigger are called implicitly.
.Stored procedure are not attached to specific table where as triggers are attached to specific table.
.Stored procedure are called by invoking a CALL to it where this does not applies in case of trigger.


(More...)

State whether delete command activate the trigger?

  
Yes, Delete command activate the trigger only if delete trigger is written on a table. (More...)

What is Trigger ,types of Trigger?

  
Trigger is a self contained block of statements that is fired when insert update delete statement(automaticaly)

two types of trigger available in sql server

1)instead of trigger
2)After Trigger

sql server 2005 trigger supporting for DML-statements(Insert ,update,delete)
sql server 2008 DML and DDL Also

(More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend