Answered by:
what is difference between views and table and stored procedure

Question
-
Hi,
i need diff between view and table and sp.
Wednesday, February 1, 2012 6:10 PM
Answers
-
Hello,
Tables contains data, views are defined queries basing on the tables and/or other views.
Stored procedures can contain various logic, like checking business rules or simple returning data like a view.
Olaf Helper
* cogito ergo sum * errare humanum est * quote erat demonstrandum *
Wenn ich denke, ist das ein Fehler und das beweise ich täglich
Blog Xing- Marked as answer by KJian_ Wednesday, February 8, 2012 2:45 AM
Wednesday, February 1, 2012 6:35 PM -
The following article shows tables for bank loan operations:
http://www.sqlusa.com/bestpractices2005/bankdatabase/
View examples:
http://www.sqlusa.com/bestpractices2008/create-view/
http://www.sqlusa.com/bestpractices/lowandhighpriceproducts/
Stored procedure examples:
http://www.google.com/search?q=stored+procedure+site:www.sqlusa.com
Tables are the basic data storage objects in a database.
Views are virtual tables, pre-canned SELECTs.
Stored procedures are programming objects returning a SELECT like result set and optionally output parameters.
CTEs, views, #temptables, derived tables & @tablevariables can be used like tables in queries.
Derived table examples:
http://www.sqlusa.com/bestpractices/derivedcorrelated/
CTE example:
http://www.sqlusa.com/bestpractices2005/cte/
Kalman Toth, SQL Server & Business Intelligence Training; SQL SERVER BEST PRACTICES
- Edited by Kalman Toth Saturday, February 4, 2012 11:26 AM
- Proposed as answer by Naomi N Sunday, February 5, 2012 5:06 AM
- Marked as answer by KJian_ Wednesday, February 8, 2012 2:45 AM
Saturday, February 4, 2012 11:17 AM
All replies
-
Hello,
Tables contains data, views are defined queries basing on the tables and/or other views.
Stored procedures can contain various logic, like checking business rules or simple returning data like a view.
Olaf Helper
* cogito ergo sum * errare humanum est * quote erat demonstrandum *
Wenn ich denke, ist das ein Fehler und das beweise ich täglich
Blog Xing- Marked as answer by KJian_ Wednesday, February 8, 2012 2:45 AM
Wednesday, February 1, 2012 6:35 PM -
Thanks for giving the answer, it is helpful.Wednesday, February 1, 2012 6:45 PM
-
The following article shows tables for bank loan operations:
http://www.sqlusa.com/bestpractices2005/bankdatabase/
View examples:
http://www.sqlusa.com/bestpractices2008/create-view/
http://www.sqlusa.com/bestpractices/lowandhighpriceproducts/
Stored procedure examples:
http://www.google.com/search?q=stored+procedure+site:www.sqlusa.com
Tables are the basic data storage objects in a database.
Views are virtual tables, pre-canned SELECTs.
Stored procedures are programming objects returning a SELECT like result set and optionally output parameters.
CTEs, views, #temptables, derived tables & @tablevariables can be used like tables in queries.
Derived table examples:
http://www.sqlusa.com/bestpractices/derivedcorrelated/
CTE example:
http://www.sqlusa.com/bestpractices2005/cte/
Kalman Toth, SQL Server & Business Intelligence Training; SQL SERVER BEST PRACTICES
- Edited by Kalman Toth Saturday, February 4, 2012 11:26 AM
- Proposed as answer by Naomi N Sunday, February 5, 2012 5:06 AM
- Marked as answer by KJian_ Wednesday, February 8, 2012 2:45 AM
Saturday, February 4, 2012 11:17 AM