Archive for October, 2009

410 Part I EXAM PREPARATION Altering Views NOTE

Saturday, October 24th, 2009

410 Part I EXAM PREPARATION Altering Views NOTE SQL Server accommodates the need to adjust a view, whether it is renaming or completely changing a view definition. This flexibility is provided via the sp_rename stored procedure and the ALTER VIEW statement. The following sections describe these two in greater depth. The Missing OBJECT In most cases, you can omit the @objtype if FIGURE 7.10 it is going to be OBJECT . The Create View Wizard is a simple five-step wizard. Renaming a View Renaming a view, or any object for that matter, is done with the sp_rename system stored procedure. sp_rename [ @objname = ] object_name , [ @newname = ] new_name [ , [ @objtype = ] object_type ] To use this procedure, first supply the original name followed by a comma and then type in the new name of the view. Because this system stored procedure is extremely generic and used for a lot of objects, you have to specifically specify OBJECT as object_type. Views, triggers, constraints, and stored procedures all belong in the category OBJECT. Renaming views and stored procedures causes the sysobjects system table to be updated. For example, to rename a view in the Pubs database you could use: use pubs GO sp_rename titleview , oldtitleview , OBJECT Use a great deal of care when renaming objects because any scripts, stored procedures, or objects that refer to the renamed object by its old name will fail to work. Editing a View You may need to change the way a view accesses data, known as the view definition. When doing this, there must already be a previously created view using only the CREATE VIEW statement. You can also drop and re-create the view, but doing so resets previously granted permissions. Using the ALTER VIEW statement, you can easily reshape

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

410 Part I EXAM PREPARATION Altering Views NOTE

Saturday, October 24th, 2009

Chapter 7 WORKING WITH VIEWS 409 Before you

Friday, October 23rd, 2009

408 Part I EXAM PREPARATION TIPEasily Creating Views

Thursday, October 22nd, 2009

Chapter 7 WORKING WITH VIEWS 407 SELECT *

Wednesday, October 21st, 2009

406 Part I EXAM PREPARATION Implementing joins within

Wednesday, October 21st, 2009

Chapter 7 WORKING WITH VIEWS 405 Northwind database.

Tuesday, October 20th, 2009

Chapter 7 WORKING WITH VIEWS 405 Northwind database.

Monday, October 19th, 2009

Chapter 7 WORKING WITH VIEWS 405 Northwind database.

Monday, October 19th, 2009

Chapter 7 WORKING WITH VIEWS 405 Northwind database.

Sunday, October 18th, 2009