Your SlideShare is downloading. ×
0
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

MS SQL SERVER: Creating Views

551

Published on

MS SQL SERVER: Creating Views

MS SQL SERVER: Creating Views

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
551
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 13<br />SQL SERVER: CREATING VIEWS<br />
  • 2. What is a View<br />A View is a query which is stored in a server in the form of an object. The Power of a view lies in the fact that it can be referenced as a table. It provides an abstraction of the underlying data.<br />The Main use of using a view is the security that it offers. A Third-Person may be restricted to view only a portion of a database, while hiding the rest of sensitive data<br />The Illustration is made in the next slide.<br />
  • 3. What is a View<br />Remember that the view exists as query and not as a table<br />
  • 4. SQL Views<br />Points to remember about SQL Views:<br /><ul><li> View is inherently a query.
  • 5. Changes made in the view will not alter a table. An explicit update must be </li></ul> made to effect a change.<br /><ul><li> All changes can be made in the view except DDL commands
  • 6. Views are used to provide additional security over data
  • 7. It also prevents unwanted tampering of sensitive data
  • 8. Views provide performance benefits</li></li></ul><li>Creating Views<br />The SQL syntax for creating a view is as follows:<br />Create view &lt;viewName&gt;<br />As<br /> …QUERY that results in a table/data…<br />GO<br />Example:<br />Consider a student table:<br />Create view NameList<br />As<br />Select regno,name from student<br />go<br />View <br />
  • 9. Using Views<br />After creating a view, it can used as if it is a table. It can queried like a normal table:<br />Select * from nameList<br />The above query on the view will return:<br />Thus, a view provides a good level of abstraction over the database.<br />
  • 10. Modifying Views<br />An existing view is modified like using the alter view statement.<br />The Syntax<br />Alter view &lt;viewName&gt;<br />As<br /> …QUERY that results in a table/data…<br />GO<br />Similar to the alter procedure statement, the alter table command redefines the existing view defenition.<br />
  • 11. Deleting Views<br />The Syntax:<br />Drop view &lt;viewName&gt;<br />Example:<br />Drop view nameList<br />
  • 12. Summary<br />13. Creating Views<br /><ul><li> About Views
  • 13. Creating Views
  • 14. Modifying Views
  • 15. Deleting Views</li></li></ul><li>Visit more self help tutorials<br />Pick a tutorial of your choice and browse through it at your own pace.<br />The tutorials section is free, self-guiding and will not involve any additional support.<br />Visit us at www.dataminingtools.net<br />

×