|
SQL Server Home
SQL Server 2000 SQL Server 2008About SQL ServerSQL Server Editions SQL Server Management Studio Create A Database Create A Table Adding Data SQL Scripts Query Designer SQL Server Views Stored Procedures User Logins Server Roles Database Schemas Linked Servers Integration Services Summary
Sponsored Links
$1.99 Domain Names
With every new non-domain purchase thru ZappyHost, you get a domain name for only $1.99. |
SQL Server - ViewsNote that this tutorial was written for those using the 2000 edition of SQL Server (SQL Server 2000). For later versions of SQL Server, check out the SQL Server 2008 tutorial. In SQL Server, a view is a pre-written query that is stored on the database. A view consists of a SELECT statement, and when you run the view, you see the results of it like you would when opening a table. Some people like to think of a view as a virtual table. This is because a view can pull together data from multiple tables, as well as aggregate data, and present it as though it is a single table. Benefits of ViewsA view can be useful when there are multiple users with different levels of access, who all need to see portions of the data in the database (but not necessarily all of the data). Views can do the following:
Creating a ViewYou create a view by using the CREATE VIEW statement, followed by the SELECT statement.
Example:
Modifing a ViewYou can modify an existing view by using using ALTER instead or CREATE. Example:
Running a ViewYou run a view by using a SELECT statement.
Running the above view results in this:
|
Sponsored Links
Need Website Content?
Get unique, quality digital content for your website.
|