C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

Main differences using views or stored procedures instead of queries


Posted Date: 24 Jun 2009      Posted By: venkatesh vadde      Member Level: Silver     Points: 1   Responses: 3



What are the main differences using views or stored procedures instead of queries(Transact sql statements)? Can any one tell me please?




Responses

Author: Nikhil Gaur    24 Jun 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

main difference is that in stored procedure we can write conditional quires but in quires we can't.

please rate the response if it helps.

Join this campus group
http://www.dotnetspider.com/sites/637/-ecb-aspdotnet.aspx

Thanks & Regards
NIks
My Software and Web Development Experience



Author: Viji RAJKUMAR    24 Jun 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hi,

Stored Procedures are in compiled form. where as queries are not in compiled form.

Thus stored procedures can run fast.

The view is actually a logical view of the table.

It will not the affect the table.

To design views , we must carefully write the joins or any complex queries, otherwise view will run very slowly.

for example,

Create View MyView AS

SELECT * FROM Table1

It's like calling "Select * from table1" twice.

Regards

VIJI RAJKUMAR
Pls rate my Answer if it was supportive
http://vijirajkumar.blogspot.com



Author: Miss Meetu Choudhary    24 Jun 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Stored Procedures are pre-complied so they will run fast and also we can add cursor and other pl-sql statments to them over queries

and views they are just a mask for the actual table which alows you to habdle the visiblity of columns to the user.. but they work on actula table only such as insertion, deletion or updation of view data will affect the table..

Thanks and Regards
Miss Meetu Choudhary (Site Coordinator)
Go Green Save Green
My Profile on Google



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : how to do exception handling in sqlserver stored procedure
Previous : Triggers
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use