C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » Databases »

Views


Posted Date: 15 Jun 2008    Resource Type: Articles    Category: Databases
Author: BuntyMember Level: Diamond    
Rating: 3 out of 53 out of 53 out of 5Points: 1



Hi,

what are the restrictions imposed on views?

Restrictions imposed on views are as follows:

1. A view can be created only in the current database.

2. The name of a view must follow the rules for identifiers and must not be the same as that of the table on which it is based.

3. A view can be created only if there is a SELECT permission on its base table.

4. A view cannot derive its data from temporary tables.

5. In a view,ORDER BY cannot be used in the SELECT statement.




Responses

Author: sangeetha    11 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


Author: hitesh    12 May 2009Member Level: Gold   Points : 1
Please correct the Point 5:

You CAN use the 'Order by' clause inside your view SELECT statement. It's allowed. You must use 'TOP (100) PERCENT' with it

Here is how you can use it.

SELECT TOP (100) PERCENT [columns you want to select]
FROM [your view name]
ORDER BY [column names]


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Sql server  .  

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: What are magic tables in SQL Server?
Previous Resource: Difference between stored procedure and functions in SQL Server
Return to Discussion Resource Index
Post New Resource
Category: Databases


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use