C# Tutorials and offshore development in India
Tutorials Resources Forum Reviews Communities Interview Jobs Projects Training Your Ad Here


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » Databases »

Getting Information on a View


Posted Date: 22 Oct 2008    Resource Type: Articles    Category: Databases
Author: Prasanth Kumar S.DMember Level: Gold    
Rating: 1 out of 5Points: 5



Getting Information on a View
--------------------------------
SQL Server stores information on the view in the following system tables:
-------------------------------------------------------------
1)SYSOBJECTS — stores the name of the view.

2)SYSCOLUMNS — stores the names of the columns defined in the view.

3)SYSDEPENDS — stores information on the view dependencies.

4)SYSCOMMENTS — stores the text of the view definition.

There are also certain system-stored procedures that help retrieve information on views. The sp_help system-stored procedure displays view-related information. It displays the view definition, provided the name of the view is given as its parameter.
------------------------------------------
Example

Sp_helptext vwCustomer
-----------------------------
Displays the definition of the vwCustomer view.

Note
-----
If a view is created with the WITH ENCRYPTION option, it cannot view the sp_helptext system-stored procedure.



Responses to the resource: "Getting Information on a View"
Author: sangeetha    12 May 2009Member Level: Gold   Points : 2
A view ia a logical representation of another table or combination of tables. A view derives its data from the tables on which it is based. These tables are called base tables. Base tables might in turn be actual tables or might be views themselves.

All operations performed on a view actually affect the base table of the view. You can use views in almost the same way as tables.You can query, update,insert into and delete from views, just as you can standard tables.

Views can provide a different representation of the data that resides within other tables and views. Views are very powerful because they allow you to tailor the presentation of data to different types of users.

> A view is a database object
> It is a virtual table whose contents are taken from other tables through the execution of a query.The changes in the table are automitacally reflected in the view.
> A view is created witha the CREATE VIEW command
> A view is queried just like querying a table.
> A user cannot distinguish between a table and a view
> Any updation of rows in tha table will automatically reflected in the view
> As a VIEW does not store any data the redundancyproblem does not araise.
> Critical data in the base table is safeguarded as access to such data can be controlled using VIEW

EX. CREATE VIEW dbo.emp_view as
SELECT ename,empno,deptno from emp


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Getting Information on a View  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Explaining 1NF
Previous Resource: Altering Views
Return to Discussion Resource Index
Post New Resource
Category: Databases


Post resources and earn money!
 
More Resources




About Us    Contact Us    Privacy Policy    Terms Of Use