Rename a view that has dependent views

From: David Walker (DWalker)
Date: 02/10/04


Date: Tue, 10 Feb 2004 09:56:02 -0700

I put this in the sqlserver.server NG, but then I thought this might be
better.
Sorry if you see it twice ;-)

SQL 2000 server: I want to standardize my naming scheme. I have views that
have other views dependent on them. I would like to rename some of these
without breaking the dependent views. It appears that sp_rename doesn't do
the trick.

Also, I'm confused about this comment in BOL: "Important After renaming
stored procedures and views, flush the procedure cache to ensure all
dependent stored procedures and views are recompiled."

I ran some tests, and it looks like sp_rename doesn't fix dependent views
that use a view that gets renamed, so what is this comment about?
Or am I missing something and sp_rename does do the trick?

Thanks. Any comments and suggestions will be appreciated.

David Walker



Relevant Pages

  • Re: Active Directory Domain Name
    ... Think again, this is especially true if you have child domains, trusts, etc. ... Dependent on the domain that you're trying to rename. ...
    (microsoft.public.windows.server.active_directory)
  • Re: ls lacking a feature?
    ... seems to do the trick for me, but this is a very cheap hack, and is dependent on what fields ls decides to print. ... ls -al | grep ^d ...
    (comp.programming)
  • Re: Rename table without breaking sp?
    ... > What is the best way to rename a table without breaking esxisting Stored ... > Procs that are dependent on the table....? ... Database? ...
    (microsoft.public.inetserver.asp.db)
  • Re: Rename table without breaking sp?
    ... Another option is to rename the table and create a view with the old table ... (Reverse address to reply.) ... > Procs that are dependent on the table....? ...
    (microsoft.public.inetserver.asp.db)