Articles → SQL SERVER → Views

Views






Purpose





Syntax


Create View <View_Name>
As
<select_statement>



Example




PersonIDPersonNameAddress
1KaranNarwana
2AmandeepAmritsar
3HarshRohtak




create view v_person As 
select 
  personID, 
  PersonName, 
  Address 
from 
  Person




select 
  PersonID, 
  PersonName 
from 
  v_Person



Output


PersonIDPersonName
1Karan
2Amandeep
3Harsh



Drop A View




drop 
  view < view_name >




drop 
  view v_Person



Posted By  -  Karan Gupta
 
Posted On  -  Friday, December 10, 2010

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250