T-SQL » Views » Renaming a View

Syntax:
sp_rename 'view1', 'view1_new'
view1
Is the name of the view, which is to be renamed.
view1_new
Is the new name of the view.

Views can be renamed. The new name must follow the rules for identifiers.

Examples

Code:
sp_rename 'vwStudentDetails', 'vwStudentDetails1';
Output:
Caution: Changing any part of an object name could break scripts and stored procedures.
The object was renamed to 'vwStudentDetails1'.
Explanation:

The above example renames the vwStudentDetails to vwStudentDetails1.

Language(s): MS SQL Server