Difference between Stored Procedures and Triggers



1. Triggers can only be implemented on tables or views but
Stored Procedure in independent code that can be specific
to database.

2. Triggers are automatically run but stored procedures are
not automatically run and they have to be called explicitly
by the user.

3. we can write a stored procedure within a trigger but
cannot write a trigger within a stored procedure.

4. Trigger is attached to table or view and is fired only
when an INSERT, UPDATE, and/or DELETE occurs, while a
stored procedure executes at any time when it is called.


A stored procedure generally performs query's on one or more tables. i.e. UPDATE, INSERT, DELETE
A trigger is tied to one table and fires based on the type of trigger you use.

Difference between web service and WCF



Major Difference is That Web Services Use XmlSerializer But WCF Uses
DataContractSerializer which is better in Performance as Compared to XmlSerializer.
Key issues with XmlSerializer to serialize .NET types to XML

* Only Public fields or Properties of .NET types can be translated into XML.
* Only the classes which implement IEnumerable interface.
* Classes that implement the IDictionary interface, such as Hash table can not be serialized.

The DataContractAttribute can be applied to the class or a strcture. DataMemberAttribute can be applied to field or a property and theses fields or properties can be either public or private.

Important difference between DataContractSerializer and XMLSerializer.

* A practical benefit of the design of the DataContractSerializer is better performance over Xmlserializer.
* XML Serialization does not indicate the which fields or properties of the type are serialized into XML where as DataCotratSerializer Explicitly shows the which fields or properties are serialized into XML.
* The DataContractSerializer can translate the HashTable into XML.