By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,379 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,379 IT Pros & Developers. It's quick & easy.

Differnece between SelectStatement in View and StoredProcedure

100+
P: 111
Hi All,

We all are creating Select statement both in View and StoredProcedure

In view it virtually links to tables.

What is the difference.

Thanks in advance
Jun 2 '08 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
By basic definition, SELECT is the way you read data in a PSQL environment. For quite some time now, it's also being used to assign values to variables and also to COLUMN alias.

A stored procedure is a collection of T-SQL commands and statements that you want to be executed sequentially in a batch. If properly handled, you can even set it up to run successfully or not run at all. A stored procedure does not require and does always have SELECT statement. If you need to read data on your table, you have to use SELECT statement.

View, on the other hand, is like a temporary table staying in the memory. Once created it will run a SELECT statement against all the tables on your view definition statement and return the resulting record set as if it's a single table. A view may or may not be update-able.


Here are more readings

SELECT (T-SQL)


Stored Proc for Beginners

View Basics

-- CK
Jun 2 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.