Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 when we are going for UDF and views

Author  Topic 

subhaoviya
Posting Yak Master

135 Posts

Posted - 2011-11-04 : 04:04:10

please help to make me clear on concepts, when we need to go for view, indexed view, inline table value function and multistatement table valued function in sql server.

thanks in advance
Subha

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-04 : 04:15:12
view is like virtual table . mostly views are used when you want some columns to be merged from various component table to get data in denormalised formatting for displaying in some reporting application. it can be used as a layer abstraction over table to avoid some columns being shown to users and including only those columns which they wants. View wont store data under default conditions. its just a definition and when you try to access it, it will execute view body logic to get required data from base tables
Indexed view or materialised view is special type of view which will be persisted(ie columns will be stored in db). mostly materialised views are used when you've lot of complex calculated column which are used in reports and would cause performance hit calculating them on the fly for each time report is rendered. Such case creating indexed view causes those calculations to be done and stored in db which can be fetched directly for reporting needs.
for inline and multistatement table valued functions see below

http://www.sqlteam.com/article/user-defined-functions

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -