Sunday, 27 July 2014

What is Trigger in SQL Server

Trigger:

             A Trigger is a database object similar to a stored procedure that executes in response to certain actions that occur in your database environment.

Triggers are 2 types:

     1. After trigger(For trigger)
     2.Instead of Trigger

After trigger(For trigger):

           After trigger are stored procedures that occurs after a data manipulation statement has occurred in the database, such as a delete statement.

Instead of Trigger:

         Instead of Trigger are objects that will execute instead of data manipulation statements in database engine. 
For example, attaching an INSTEAD-OF INSERT trigger will tell the the database to engine to execute that trigger instead of executing that  statement that would insert values into that table.

Syntax: 

CREATE TRIGGER trigger_name
ON {table| view}
[WITH ENCRYPTION]
{{AFTER|FOR | INSTEAD OF | }{[INSERT][,][DELETE] [UPDATE]}
AS
         sql_statement[....n]
}
}


Sunday, 20 July 2014

Difference between WCF and WPF


WCF - Windows COMMUNICATION Foundation
WPF - Windows PRESENTATION Foundation.
WCF deals with communication (in simple terms - sending and receiving data as well as
formatting and serialization involved), WPF deals with presentation (UI)


The quick answer is:  
      Windows Presentation Foundation (WPF) is basically a way of displaying
user interface. 
      Windows Communication Foundation (WCF) is a framework for creating service oriented 
applications. 
       As for which one you should use, it depends on your requirement. Usually an application written 
in WPF, ASP.NET..etc called the WCF service to do some processing at the server-side and the
 service returns the result to the application that called it.