SQL : Categories : 뷰(View).
-- ※ Create View
-- [7] 뷰(View) 생성 :
-- [a] 대분류 데이터를 출력하는 구문을 줄여서 출력
Select CategoryID, CategoryName From Categories Where SuperCategory Is NULL Order By CategoryName Asc
-- [b] 위 구문을 줄여주는 뷰(View) 생성
Create View dbo.GetTopCategory
As
Select CategoryID, CategoryName
From Categories
Where SuperCategory Is NULL
-- Order By CategoryName Asc
Go
-- [c] 뷰 사용 : 약간 줄어들죠???
Select * From GetTopCategory
Order By CategoryName Asc
-- [d] 뷰(가상 테이블) 수정 : 암호화
sp_helptext GetTopCategory -- 뷰 구문 보기
Alter View dbo.GetTopCategory
With Encryption -- 개체 암호화 옵션
As
Select CategoryID, CategoryName
From Categories
Where SuperCategory Is NULL
-- Order By CategoryName Asc
sp_helptext GetTopCategory -- 뷰 구문 안보임
-- [e] 뷰 삭제
Drop View dbo.GetTopCategory
Go
[출처] 웹디황용
"쇼핑몰·홈페이지·오픈마켓
블로그·페이스북·이메일 등의 각종 마케팅 글쓰기, 각종 광고, 영업, 판매, 제안서, 전단지 반응율 3배×10배 이상 높이는 마법의 8단계 공식" |
☞자세히보기 |
|
|