412 Part I EXAM PREPARATION ALTER VIEW EmployeeView

412 Part I EXAM PREPARATION ALTER VIEW EmployeeView AS SELECT emp_id, fname, lname, job_lvl FROM Employee WHERE job_lvl <150 You may find that SQL Server does not allow you to perform tasks because of one dependency or another. For instance, all objects are dependent on their owner, so you are not able to drop a user from the database if they own objects. The number of database objects that the server checks for dependencies is very large, but it is easy to find out what objects they are. A quick query of sysobjects can reveal any object ownership dependencies. Scripts, stored procedures, and views can exist anywhere, and refer to tables or views in your database. There is no easy location that can be checked that tells SQL Server who is referencing your table or view. Another user can reference your view from an entirely different server, without your knowledge, if that user has been granted the SELECT permission to it. Therefore, there is no back-checking of integrity when you change the structure of tables or views who knows who might be using it? When examining the situation from this perspective, it is easy to see why SQL Server does not check; but it is still surprising that it does not check. Take for example the following script: USE pubs GO CREATE VIEW AuthorInfo AS SELECT au_id, au_fname, au_lname, city, zip FROM dbo.Authors GO CREATE VIEW AuthorShortInfo AS SELECT au_id, au_fname, city FROM dbo.AuthorInfo GO ALTER VIEW AuthorInfo AS SELECT au_id, au_fname, au_lname, zip FROM dbo.Authors GO SELECT * FROM AuthorShortInfo Running this script would yield the following error messages in Query Analyzer: Server: Msg 207, Level 16, State 3, Procedure

For high quality website hosting services please check java web hosting website.

Comments are closed.