.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 Trigger ,types of Trigger?

Posted By :sriram     Posted Date :October 27, 2011    Points :40   Category :Sql Server 
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



You can also find related Interview Question to What is Trigger ,types of 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...)

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...)

All types in C# implicitly derive from.........

  
System.Object Class. System.Object is the parent class of all .NET classes (More...)

What are the types of indexes available with SQL Server?

  
There are basically two types of indexes that we use with the SQL Server. Clustered and the Non-Clustered. (More...)

Different Types of Remote Objects?

  
The remoting infrastructure allows you to create two distinct types of remote objects.

1.Client-activated objects - A client-activated object is a server-side object whose creation and destruction is controlled by the client application. An instance of the remote object is created when the client calls the new operator on the server object. This instance lives as long as the client needs it, and lives across one to many method calls. The object will be subject to garbage collection once it''s determined that no other clients need it.

2.Server-activated objects - A server-activated object''s lifetime is managed by the remote server, not the client that instantiates the object. This differs from the client-activated object, where the client governs when the object will be marked for finalization. It is important to understand that the server-activated objects are not created when a client calls New or Activator.GetObject. They are rather created when the client actually invokes a method on the proxy. There are two types of server activated objects. They are:

I. Single call . Single-call objects handle one, and only one, request coming from a client. When the client calls a method on a single call object, the object constructs itself, performs whatever action the method calls for, and the object is then subject to garbage collection. No state is held between calls, and each call (no matter what client it came from) is called on a new object instance.

II.Singleton - The difference in a singleton and single call lies in lifetime management. While single-call objects are stateless in nature, singletons are stateful objects, meaning that they can be used to retain state across multiple method calls. A singleton object instance serves multiple clients, allowing those clients to share data among themselves. (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