April 7, 2008 at 8:30 am
Hi Guys,
Is there any way in SQL to change all the user table names to lowercase.
Regards
Imke
April 7, 2008 at 8:39 am
You can use the sp_rename stored procedure.
April 7, 2008 at 8:43 am
Do you perhaps have a script that will update all the tables at once and not one by one
April 7, 2008 at 8:45 am
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
April 7, 2008 at 9:36 am
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.
April 7, 2008 at 10:27 pm
Google for sp_MSForEachTable...
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply