Chapter 7 WORKING WITH VIEWS 411 the definition

Chapter 7 WORKING WITH VIEWS 411 the definition of a view without affecting permissions granted. The syntax for ALTER VIEW is as follows: ALTER VIEW [ < database_name > . ] [ < owner > . ] .view_name [ ( column [ ,…n ] ) ] [ WITH < view_attribute > [ ,…n ] ] AS < select_statement > [ WITH CHECK OPTION ] < view_attribute > ::= { ENCRYPTION | SCHEMABINDING | VIEW_METADATA } The syntax is relatively similar to CREATE VIEW. view_name is the name of the view being altered. The WITH ENCRYPTION clause protects the definition of your view. You encrypt the definition of your view because you may not want users to display it, to protect your design WARNING Don t Be Careless with Changes from duplication. Encrypting your view using WITH ENCRYPTION Altering views or tables that are ensures that no one can display your view, whether using sp_helptext, used by views may cause the viewing it through the Enterprise Manager, or generating it through dependent views to stop working. a Database Creation Script. SQL Server does not back-check all table or view alterations to If your original view was created with WITH ENCRYPTION or WITH ensure they do not create errors. SCHEMABINDING, then your ALTER VIEW statement must include the This is where the SCHEMABINDING same options. To alter a view using ALTER VIEW, see Step by Step 7.4 option helps out. If you have SCHEMA-bound objects, then you cannot ALTER the source objects at all. It may be preferable to drop and recreate a series of STEP BY STEP 7.4 Altering a View Using the ALTER VIEW objects, rather than have objects Statement that do not function. This means more planning. 1. Open the SQL Server Query Analyzer by selecting it from the Start menu. 2. Before altering the definition of a view, there must already be an existing view. Run the following query to create a new view for the purposes of this example: USE pubs GO CREATE VIEW EmployeeView AS SELECT emp_id, fname, lname, job_lvl FROM Employee WHERE fname LIKE p% 3. To change the definition of the view you created in Step 2, you need the help of the ALTER VIEW statement. Run the following query:

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

Comments are closed.