Scott Fell
asked on
Mass rename SQL tables
I have inherited a db with tables named like
dbo.xyz_aaaa
dbo.xyz_bbb
dbo.abc_cccc
dbo.abc_dddd
dbo.eeee
dbo.ffff
Everything to the right of the underscore is unique and I want to end up with
dbo.aaaa
dbo.bbb
dbo.cccc
dbo.dddd
dbo.eeee
dbo.ffff
Is there a way to use sql server to mass update dbo.xyz_aaaa to dbo.aaaa including any Views or Stored procedures. Or do I just use the generate scripts function, use the editor to do to a find and replace, then recreate?
dbo.xyz_aaaa
dbo.xyz_bbb
dbo.abc_cccc
dbo.abc_dddd
dbo.eeee
dbo.ffff
Everything to the right of the underscore is unique and I want to end up with
dbo.aaaa
dbo.bbb
dbo.cccc
dbo.dddd
dbo.eeee
dbo.ffff
Is there a way to use sql server to mass update dbo.xyz_aaaa to dbo.aaaa including any Views or Stored procedures. Or do I just use the generate scripts function, use the editor to do to a find and replace, then recreate?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Another solution :
http://raresql.com/2013/01/28/sql-server-mass-renaming-of-sql-tables/
http://raresql.com/2013/01/28/sql-server-mass-renaming-of-sql-tables/
ASKER
Thanks, I got it done. For the views and stored procs I just generated the script and did a find and replace.
You are Welcome
ASKER