Home Dashboard Directory Help
Search

SQL Server Management Studio Rename problem for View, SP and UDF by Vlad Kurshin


Status: 

Closed
 as By Design Help for as By Design


0
0
Sign in
to vote
Type: Bug
ID: 333094
Opened: 3/14/2008 2:09:15 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Renaming View, SP, or UDF using SQL Server Management Studio does not change the field “Definition” (the actual field name might be different, we can only see it through the views) in underlining system table.
Details
Sign in to post a comment.
Posted by Microsoft on 3/18/2008 at 8:40 AM
Hi Vlad,
Thanks for your feedback on this. This is by design. Sys.sql_modules stores the actual script specified when creating a module. Renaming a sql module such as a stored procedure will not update the definition in sys.sql_modules.
This is documented in BOL topic sp_rename:
Renaming a stored procedure, function, view, or trigger will not change the name of the corresponding object name in the definition column of the sys.sql_modules catalog view. Therefore, we recommend that sp_rename not be used to rename these object types. Instead, drop and re-create the object with its new name.

Srini Acharya
Relational Engine




Posted by Microsoft on 3/18/2008 at 8:40 AM
Hi Vlad,
Thanks for your feedback on this. This is by design. Sys.sql_modules stores the actual script specified when creating a module. Renaming a sql module such as a stored procedure will not update the definition in sys.sql_modules.
This is documented in BOL topic sp_rename:
Renaming a stored procedure, function, view, or trigger will not change the name of the corresponding object name in the definition column of the sys.sql_modules catalog view. Therefore, we recommend that sp_rename not be used to rename these object types. Instead, drop and re-create the object with its new name.

Srini Acharya
Relational Engine




Sign in to post a workaround.