• Save
MS SQLSERVER:Creating Views
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

MS SQLSERVER:Creating Views

  • 761 views
Uploaded on

MS SQLSERVER:Creating Views

MS SQLSERVER:Creating Views

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
761
On Slideshare
704
From Embeds
57
Number of Embeds
6

Actions

Shares
Downloads
0
Comments
0
Likes
1

Embeds 57

http://www.ustudy.in 44
http://ustudy.in 5
http://www.dataminingtools.net 4
http://www.slideshare.net 2
http://dataminingtools.net 1
http://localhost:3000 1

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
    SQL SERVER: CREATING VIEWS
  • 2. What is a View
    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.
    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
    The Illustration is made in the next slide.
  • 3. What is a View
    Remember that the view exists as query and not as a table
  • 4. SQL Views
    Points to remember about SQL Views:
    • View is inherently a query.
    • 5. Changes made in the view will not alter a table. An explicit update must be
    made to effect a change.
    • 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
  • Creating Views
    The SQL syntax for creating a view is as follows:
    Create view <viewName>
    As
    …QUERY that results in a table/data…
    GO
    Example:
    Consider a student table:
    Create view NameList
    As
    Select regno,name from student
    go
    View
  • 9. Using Views
    After creating a view, it can used as if it is a table. It can queried like a normal table:
    Select * from nameList
    The above query on the view will return:
    Thus, a view provides a good level of abstraction over the database.
  • 10. Modifying Views
    An existing view is modified like using the alter view statement.
    The Syntax
    Alter view <viewName>
    As
    …QUERY that results in a table/data…
    GO
    Similar to the alter procedure statement, the alter table command redefines the existing view defenition.
  • 11. Deleting Views
    The Syntax:
    Drop view <viewName>
    Example:
    Drop view nameList
  • 12. Summary
    13. Creating Views
  • Visit more self help tutorials
    Pick a tutorial of your choice and browse through it at your own pace.
    The tutorials section is free, self-guiding and will not involve any additional support.
    Visit us at www.dataminingtools.net