Syntax:
sp_rename @ObjectName, @ObjectNewName, @ObjectType
WHERE:
@ObjectName: is the name of the user object etc.
@ObjectNewName: is the new name of the user object. It has no defaults.
@ObjectType: defines the type of the user object to be renamed. The following types are supported:
- A column
- A database
- An Index
- UserDataType ( Alias type, objects created using CREATE statement and CLR user defined types)
1 comment:
Note that it is not a good idea to rename stored procedures, functions etc. It is far more safer to drop the procedure/function and recreate them with the new definition. See this: http://www.sqlserverandxml.com/2008/09/be-careful-when-renaming.html
Post a Comment