Globally renaming table name,constraint names,stored proc names

Posted on 2006-04-21
Last Modified: 2012-08-13

I am using MS SQL Server 2005. Is there a way I can rename all the say if all my table names,stored procs etc are prefixed by xxxxxxx can I rename it by yyyyyy globally?

pls help
Question by:sureshraina
    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    you need to change the ownership
    use sp_changeObjectOwner
    LVL 65

    Expert Comment

    by:Jim Horn
    Speed Ferret (, free limited 30-day trial, $199 buy) allws you to change text globally in  Visual Basic, SQL Server, and Access all at the same time.

    Hope this helps.
    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    Sorry, leave my previous comments. I thought of changing the ownerships
    LVL 28

    Expert Comment

    use this command

    CREATE SCHEMA yyyyyy

    ALTER SCHEMA yyyyyy TRANSFER xxxxxxx.TableName;

    Author Comment

    Thanks imran.

    But will this change in all the stored procedures,constraints,tables,views,functions???
    LVL 28

    Accepted Solution

    Yes you can transfer any object.

    ALTER SCHEMA yyyyyy TRANSFER xxxxxxx.object_name

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
    Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now