PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.setup > anyone know how to change the name of a view in sql2005?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
ms.sqlserver.setup Questions about SQL Server.

anyone know how to change the name of a view in sql2005?

Réponse
 
LinkBack Outils de la discussion
Vieux 04/11/2006, 00h14   #1
Jay B
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut anyone know how to change the name of a view in sql2005?

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
  Réponse avec citation
Vieux 04/11/2006, 03h06   #2
Arnie Rowland
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: anyone know how to change the name of a view in sql2005?

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



  Réponse avec citation
Vieux 04/11/2006, 05h22   #3
Sue Hoegemeier
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: anyone know how to change the name of a view in sql2005?

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


  Réponse avec citation
Vieux 04/11/2006, 07h10   #4
Arnie Rowland
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: anyone know how to change the name of a view in sql2005?

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

>



  Réponse avec citation
Vieux 04/11/2006, 08h56   #5
Jay B
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: anyone know how to change the name of a view in sql2005?

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

>

  Réponse avec citation
Vieux 04/11/2006, 16h12   #6
Sue Hoegemeier
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: anyone know how to change the name of a view in sql2005?

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.


  Réponse avec citation
Vieux 04/11/2006, 17h35   #7
Arnie Rowland
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: anyone know how to change the name of a view in sql2005?

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.

>



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h59.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13759 seconds with 15 queries