Wednesday, June 23, 2010

SQL SERVER – Differences Between a View and a Stored Procedure

View

View is a Logical way of Looking at the data that is located in the Physical table. View Contains Only the definition but not the Data.

View Contains only the Select Statement. CREATE,INSERT,UPDATE,DELETE and TRUNCATE Statements are not Allowed.

Views does not Contain any Parameters.

Views does not Contain ‘Select Into’, ‘Group By’ , ‘Order By’ and ‘Having’.

Stored Procedure

Stored Procedure is a database object which can used to move the data from the application to the Backend enforcing the Business Rules.

In addition to the Select statement, Stored Procedure contains all the DML statements like INSERT,UPDATE,DELETE and TRUNCATE Statements.

Stored Procedure can contain three types of Parameters IN, OUT and INOUT.

Stored Procedure can have  the clauses like  ‘Group By’ , ’Order By’, ’Having’

 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.