May 24, 2009 at 3:02 am
Comments posted to this topic are about the item Rename objects
May 25, 2009 at 6:33 am
Hi,
Maybe i am declaring myself as foolish, but what is the big difference between renaming an object and dropping and re-creating it with a different name (except that the later will let you lose all the object's information as well)?
Best regards,
Dietmar.
Best regards,
Dietmar Weickert.
May 25, 2009 at 9:08 am
Reference: sys.objects: (BOL)
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/f8d6163a-2474-410c-a794-997639f31b3b.htm[/url
O.K. someone explain to me where I went wrong. From sys.objects, type column appears:
type char(2) Object type:
. . . . . .. . . . .V = View
So is a View an object or isn't it?
Further from BOL How to: Rename Views
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/5eed0488-81d2-40e8-8fdf-b0a640a591d0.htm
The name of a view cannot be changed but, rather, a new view must be created with the desired new name and the old view definition copied into the new view.
Bold face added to highlight what I believe makes the answer qiven as the correct answer actually incorect.
May 25, 2009 at 9:47 am
Dropping and recreating should give it a new ID, as well as change the versioning. IF there is substantial data in the object, that can take time.
Renaming just changes the meta data, and while there are restrictions, it is possible.
May 25, 2009 at 10:53 am
Edited after post by
beezell
If you create a view and use the sp_rename stored proc you can rename it. This might be an error in BOL.
Must be so, did it and you are correct it did rename the view.
My apologies to Steve Jones and to VM the author of the QOD
My lame argument that the answer was not correct as given has been removed ... since my argument was NOT correct, and I stand corrected.
May 26, 2009 at 6:43 am
If you create a view and use the sp_rename stored proc you can rename it. This might be an error in BOL.
Cheers,
Brian
May 28, 2009 at 5:20 am
One 'gotcha' is that if you rename a stored procedure, the code returned by sp_helptext will still have the original name 🙂
June 19, 2009 at 7:33 am
wow what about sys objects! in the question doesn't mention about user or system objects so for that reason the question include also the system objects - and sure that you can not rename the system objects!
:-P:-P:-P
July 1, 2009 at 7:33 am
While some of us got the answer right, the "right" answer was a little misleading. You actually (obviously) cannot rename system objects. So, technically, not ALL objects can be renamed. :hehe:
Kindest Regards,Rick Farris
October 2, 2009 at 9:03 am
You also cannot rename symmetric keys. Just fought that battle.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply