Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is a stored procedure and trigger?

Answers were Sorted based on User's Feedback



what is a stored procedure and trigger?..

Answer / ramesh

stored procedure:

Group of sql statements compiled into single execution plan.

create procedure sp_procedurename
as
begin
begin transaction
select * from table

if @@error=null
commit

else
rollback

end

Trigger
--------

Trigger is a set of sql queries which fire when an event
occurs(delete,update,insert).

in 2005 DDL TRIGGER INTRUDUCED.

Is This Answer Correct ?    3 Yes 0 No

what is a stored procedure and trigger?..

Answer / sandeep

First of all both are precompiled sql statements stored at
database server.

1. Stored procedures can return values to the caller
whereas triggers cant.

2. we cant call a trigger directly becos it is called by
the database server on an event(automatically raised on
insert,update,delete statements).

3. triggers can access datas from outside world(outside of
the Database).

Is This Answer Correct ?    0 Yes 0 No

what is a stored procedure and trigger?..

Answer / shashi kishor prasad

1.Stored Procedures are Pre-compiled functions that needs to
be called but Triggers are event driven and can't be called
explicitly like stored procedures

2.Stored procedures can take arguments but Triggers dont
take arguments.

3.Stored procedures cant get executed unless they are called
by by the calling program but Triggers gets fired as soon as
an event for which it has been created takes place.

4. Stored procedures can work on the database and values it
has been assigned but Triggers can work on db other than that.

5.Stored Procedures are used to make the execution faster
and to prevent from sql injections to some extent but
Triggers are used to achieve different tasks on occurrence
of an event like insert update and delete on a table.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

what is the difference between delete table and truncate table commands? : Sql server database administration

0 Answers  


What is blocking and how would you troubleshoot it?

3 Answers   HCL,


How to delete the duplicate rows from a table in SQL Server ??

3 Answers  


What is difference in performance between insert top (n) into table and using top with insert?

0 Answers  


What are the basic functions for master, msdb, model, tempdb databases?

0 Answers  


Can we use trigger new in before insert?

0 Answers  


What is a field name?

0 Answers  


Can we call future method from trigger?

0 Answers  


What is database dimension? : sql server analysis services, ssas

0 Answers  


can anyone explain me the concept of Serialization in Detail and Clear? plz its urgent i have interview on friday (15th feb)

1 Answers  


Mention the command used to rename the database.

0 Answers  


What are the advantages of using stored procedures?

0 Answers  


Categories