Site sponsored by: Idera The gold standard of SQL Server performance monitoring & diagnostics.
SQL Server Performance

  • Home
  • Articles
  • Forums
  • Tips
  • Quiz
  • FAQ's
  • Blogs
  • Software
  • Books
  • About Us
RSS Feeds
Sign in | Join


Article Topics

All Articles
Performance Tuning
Audit
Business Intelligence
Clustering
Reporting Services
Developer
General DBA
ASP.NET / ADO.NET

Write for Us

Share you SQL Server knowledge with others and raise your profile in the community More...
Latest Articles

Differential Database Backups in SQL Server
Claytons Data Mining (Part 2)
Backup System Databases Using Maintenance Plans
Overview of Maintenance Plans in SQL Server 2008

More     
 
Latest FAQ's

How to alter a User Defined Data Type?
How to unzip a File in SSIS?
How to view previous query plans?
ALTER TABLE SWITCH statement failed because the object '%.*ls' is not ...

More     
   
Latest Software Reviews

Spotlight on ApexSQL Doc 2008
ApexSQL Enforce
Embarcadero Change Manager
SQL Server DBA Dashboard

More     

articles >> general dba >> SQL Server 2000: View Basics ...

SQL Server 2000: View Basics

By : Navneeth Diwaker Naik
Jan 16, 2004

Page 3 / 3

INSTEAD OF trigger on a View

SQL SERVER 2000 allows triggers on a View. That’s really great. Previous version of SQL SERVER did not allow this. Again, this is a new feature in SQL SERVER 2000. But remember you can create only INSTEAD OF triggers on Views.

CREATE VIEW vwSample

As

SELECT

          CustomerID,

          CompanyName,

          ContactName

FROM DBO.CUSTOMERS

GO

 

Limitations of Views

There are some limitations when using Views. They are:

  • SELECT INTO cannot be used in the View
     
  • Temporary tables cannot be used within the View
     
  • Parameterized views does not exists i.e., you cannot pass parameters to the Views
     
  • COMPUTE & COMPUTE BY clauses cannot be used within the View

 

Views and User-Defined Functions

Views and User-Defined Functions almost serve the same purpose. But the major difference is that User-Defined Function can accept parameters, whereas Views cannot. And also the output of the User Defined Function can be directly used in the SELECT clause, whereas you cannot do it with a View.

 

Summary

Views are nothing but saved SQL statements. User can insert, delete or update the data using the Views in SQL SERVER 2000. Indexes and Triggers can also be created on Views, with an exception that the first Index should be UNIQUE CLUSTERED INDEX and the trigger should be INSTEAD OF trigger. Views and User-Defined Functions serve almost the same purpose with an exception that User-Defined Functions accept parameters, whereas Views will not.

 

Navneeth Diwaker Naik (navneeth_naik@satyam.com) is an employee of Satyam Computers Services Limited, Hyderabad, Andhra Pradesh. [INDIA].

Published with the explicit written permission of the author. Copyright 2004.


<< Prev Page         








Home | Peformance Articles | Audit Articles | Business Intelligence Articles | Clustering Articles | Developer Articles | Reporting Services Articles | DBA Articles | ASP.NET / ADO.NET Articles | DBA FAQ's | Developer Peformance FAQ's | DBA Peformance FAQ's | Developer FAQ's | Clustering FAQ's | Error Messages | Audit Tool Reviews | Backup Tool Reviews | Coding Tool Reviews | Compare Tool Reviews | Documentation Tool Reviews | Design Tool Reviews | Monitoring Tool Reviews | Log Tool Reviews | Reporting Tool Reviews | Clustering Tool Reviews | Security Tool Reviews | Change Management Tool Reviews | Remote Access Tool Reviews | Book Reviews | Security Tool Reviews | QDPMA Performance Tuning | ADO.NET / ASP.NET | Administration | Analysis/OLAP Services | Application Development | Configuration | Components | ETL | Hardware | High Availability | Hints | Index | Misc | Operating Systems | Performance Tuning | Replication | T-SQL | Views


              © 1999-2008 by T10 Media. All rights reserved