|
|
|
|
||||||
| ms.sqlserver.setup Questions about SQL Server. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
does anyone know how to change the name of a view in sql2005?
it seems to be different than sql2000, where i would just go into properties and be able to change the name of the view by editing the sql code. i dont seem to see where to do that. i know i could recreate it, but it should be a way to change the name. thanks Jay |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
According to Books Online, you can't rename a view.
You have to recreate the view with the new name, and drop the old view. -- Arnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous You can't someone get up a hill without getting a little closer to the top yourself. - H. Norman Schwarzkopf "Jay B" <jayB@audiman.net> wrote in message news:TXQ2h.4673$Pi3.1020@newsfe12.lga... > does anyone know how to change the name of a view in sql2005? > > it seems to be different than sql2000, where i would just go into > properties and be able to change the name of the view by editing the sql > code. i dont seem to see where to do that. > > i know i could recreate it, but it should be a way to change the name. > thanks Jay |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
EXEC dbo.sp_rename 'Schema.YourView', 'NewViewName', OBJECT
You can find more information in Books Online under sp_rename. In Management Studio, you can right click on the view and select Rename. -Sue On Fri, 03 Nov 2006 19:14:43 -0500, Jay B <jayB@audiman.net> wrote: >does anyone know how to change the name of a view in sql2005? > >it seems to be different than sql2000, where i would just go into >properties and be able to change the name of the view by editing the sql >code. i dont seem to see where to do that. > >i know i could recreate it, but it should be a way to change the name. >thanks Jay |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Duh! That will teach me to rely upon the assumption that the OP was only
referring to the GUI ("go into properties") AND Books Online -without testing the other options. From BOL: "renaming views" ms-://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/5eed0488-81d2-40e8-8fdf-b0a640a591d0.htm How to: Rename Views (Visual Database Tools) 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. -- Arnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous You can't someone get up a hill without getting a little closer to the top yourself. - H. Norman Schwarzkopf "Sue Hoegemeier" <Sue_H@nomail.please> wrote in message news:ji8ok2ppf73ko76b2tknekhs0ldt5l5st1@4ax.com... > EXEC dbo.sp_rename 'Schema.YourView', 'NewViewName', OBJECT > You can find more information in Books Online under > sp_rename. > > In Management Studio, you can right click on the view and > select Rename. > > -Sue > > On Fri, 03 Nov 2006 19:14:43 -0500, Jay B <jayB@audiman.net> > wrote: > >>does anyone know how to change the name of a view in sql2005? >> >>it seems to be different than sql2000, where i would just go into >>properties and be able to change the name of the view by editing the sql >>code. i dont seem to see where to do that. >> >>i know i could recreate it, but it should be a way to change the name. >>thanks Jay > |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
thanks, that was sweet, right under my nose.
Sue Hoegemeier wrote: > EXEC dbo.sp_rename 'Schema.YourView', 'NewViewName', OBJECT > You can find more information in Books Online under > sp_rename. > > In Management Studio, you can right click on the view and > select Rename. > > -Sue > > On Fri, 03 Nov 2006 19:14:43 -0500, Jay B <jayB@audiman.net> > wrote: > >> does anyone know how to change the name of a view in sql2005? >> >> it seems to be different than sql2000, where i would just go into >> properties and be able to change the name of the view by editing the sql >> code. i dont seem to see where to do that. >> >> i know i could recreate it, but it should be a way to change the name. >> thanks Jay > |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
That article is referring to the Visual Database Tools only
- so it's referring to the Query and View Designer. Not SSMS and not T-SQL. While in SSMS, if you do a modify on the view it will open the view in the designer and from here you can't rename a view. But views CAN be renamed. Just not from that particular tool. And they can be renamed in the GUI through SSMS. Just not in the view designer. It would probably be better if the article was more specific in clarifying that views can't be renamed through this tool - if needing to rename use TSQL or SSMS, blah, blah. -Sue .. On Fri, 3 Nov 2006 23:10:19 -0800, "Arnie Rowland" <arnie@1568.com> wrote: >Duh! That will teach me to rely upon the assumption that the OP was only >referring to the GUI ("go into properties") AND Books Online -without >testing the other options. > >From BOL: "renaming views" > >ms-://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/5eed0488-81d2-40e8-8fdf-b0a640a591d0.htm > >How to: Rename Views (Visual Database Tools) > >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. |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
I appreciate that you provided 'corrected' information to the OP. I have
major 'red face' from my ignorant response. I should have done the obvious and checked out the process -my only excuse is 'it was a long and exhausting day, and I responded without giving due concern.' Now to go and beat myself with wet noodles in private... -- Arnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous You can't someone get up a hill without getting a little closer to the top yourself. - H. Norman Schwarzkopf "Sue Hoegemeier" <Sue_H@nomail.please> wrote in message news:dcepk2hjaruh54893iqv2ph08bmm7nrojk@4ax.com... > That article is referring to the Visual Database Tools only > - so it's referring to the Query and View Designer. Not SSMS > and not T-SQL. While in SSMS, if you do a modify on the view > it will open the view in the designer and from here you > can't rename a view. But views CAN be renamed. Just not from > that particular tool. And they can be renamed in the GUI > through SSMS. Just not in the view designer. > > It would probably be better if the article was more specific > in clarifying that views can't be renamed through this tool > - if needing to rename use TSQL or SSMS, blah, blah. > > -Sue > . > On Fri, 3 Nov 2006 23:10:19 -0800, "Arnie Rowland" > <arnie@1568.com> wrote: > >>Duh! That will teach me to rely upon the assumption that the OP was only >>referring to the GUI ("go into properties") AND Books Online -without >>testing the other options. >> >>From BOL: "renaming views" >> >>ms-://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/5eed0488-81d2-40e8-8fdf-b0a640a591d0.htm >> >>How to: Rename Views (Visual Database Tools) >> >>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. > |
|
![]() |
| Outils de la discussion | |
|
|