Click here to Skip to main content
15,886,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
1.where are views stored once they are created?
2.if indexes are created on views where are it stored?
3.does the indexes created on view doesnt reflect base tables?if "NO" y?
4.how does indexes arranged in views...as by definition " view ia a complied query"?


please giv me clarification....?


thans in advance
Posted
Comments
Ankur\m/ 20-Feb-13 2:32am    
Try Google search. You will get answer faster than typing + reply time.
Edit: See the first answer. Found using Google search. ;)

1.where are views stored once they are created?
In the current database. Have a look.
To see the view:
SQL
SELECT * FROM sys.[views] v


To see the view definition(SQL Query) :

SELECT * FROM sys.sql_modules sm WHERE sm.definition LIKE '%yourviewname%'



2.if indexes are created on views where are it stored?
In the local disk specially for non clustered index. Again to see the definition use the above query.

3.does the indexes created on view doesnt reflect base tables?if "NO" y?
Are talking about indexed view? No it does not reflect the underlying tables. because when appropriate index is created on views, the index is used by the optimizer. If the index(created on view) is not appropriate one, in that case optimizer go for index created on actual table.

4.how does indexes arranged in views...as by definition " view ia a complied query"?
As usual, but there are some restriction for indexed view. Actually when a query is run in the for the first time SQL Server creates a plan for it for subsequent runs.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900