Changing tables names to lowercase

  • Hi Guys,

    Is there any way in SQL to change all the user table names to lowercase.

    Regards

    Imke

  • You can use the sp_rename stored procedure.

  • Do you perhaps have a script that will update all the tables at once and not one by one

  • Imke Cronje (4/7/2008)


    Hi Guys,

    Is there any way in SQL to change all the user table names to lowercase.

    Regards

    Imke

    Is your database case sensitive? If so, then you will need to update the references to these tables. In this case I'd suggest a third party refactoring tool. If your database is not cases sensitive, and you only want to change the names of the table, and not the references, then as Michael suggested sp_rename is OK for tables (but not for stored procedures, triggers, etc. whose name is stored both in meta data tables (that you can see via system views) and as text (you can get it from sys.sql_modules) (sp_rename does not modify the stored text).)

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Imke Cronje (4/7/2008)


    Do you perhaps have a script that will update all the tables at once and not one by one

    No, but it should be easy enough for you to write one.

    Make sure you understand the implications of everything that Andras said in his post, and that you have a good reason for doing this.

  • Google for sp_MSForEachTable...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply