What is the difference between a view and a stored procedure?



What is the difference between a view and a stored procedure?..

Answer / Sarvesh Kumar Prajapati

In SQL Server, a view is a virtual table based on the result-set of an SQL statement, whereas a stored procedure is a prepared SQL code that stores pre-compiled execution plans. A view does not modify data and cannot be executed like a standalone program; it simply represents the data in different formats for querying. On the other hand, a stored procedure can contain SQL statements to create, insert, update, delete or retrieve data and can accept parameters.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Can you explain about buffer cash and log cache in sql server?

1 Answers  


Introduction of rollup clause using sum and group by clause?

1 Answers  


How to locate and take substrings with charindex() and substring() functions?

1 Answers  


last function used in MS Access to convert sql what function will use in sql

1 Answers   Cap Gemini,


How To delete duplicate record from a particular table?

12 Answers   eXensys, Foxfire,


How to get a list of all tables with "sys.tables" view in ms sql server?

1 Answers  


Explain datetimeoffset data type in sal server 2008?

1 Answers  


What are pessimistic lock and optimistic lock?

1 Answers  


Can an entity have two primary keys?

1 Answers  


What is the security principal at the database level that represents your session?

1 Answers  


What is sqlcmd?

1 Answers  


What is the difference between implicit and explicit transaction?

1 Answers   Beahead Private Limited,


Categories