Become Joomla Developer

How To Create View in SQL Server 2005

Create View

  1. Right Click on Views and Click on New View...
    Create View
  2. After you click on New View... you will see a new dialog box that need you add your table.
    To Add your table you can double click on your table name or select your table name and than click Add button.
    After you add table your already. You can Click Close button to finish add table.
    Add Table
  3. Tick on columns name that you want to select it from your table.
    Select Columns
    Or you can write your SQL Statement to select it by condition too. Ex:
    SELECT     Price, ProductName, ProductID
    FROM         dbo.tblProduct
    WHERE     (ProductID = 1)
    
  4. Click on Button Execute to show your result.
    Execute Button
    Or you can click on Query Designer and then click on Execute SQL.
    Execute SQL
  5. after your excute you will see your result
    This is the Result
  6. Click on Save Button to Save your view
    Save your View
  7. Enter your view name and then click Ok button. when you want select data from table product you can select it from your view.
    Enter View Name

Select View

  1. Open New Query
    New View
  2. Write SQL Statement:
    USE TestDatabase
    SELECT * FROM vwSelectProduct
    
    And then press key F5 to Execute your SQL Statement. Or click on Execute SQL Statement button
    Execute Button
  3. After you execute your SQL Statement you will see your result.
    Select View

Suggestion | Contact US | About US | Term of Use | Privacy Policy | Advertiseing