Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is there a way to rename database objects such as tables, stored-procedures, etc, during a restore of a .BAK file to a new database?

share|improve this question
    
As in during the restore process? –  Kev Jan 18 '12 at 1:20
add comment

migrated from stackoverflow.com Jan 18 '12 at 1:21

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 3 down vote accepted

You will be able to do this after the restoration process, when the database is in NORECOVERY mode. Concurrently? No, there isn't a way.

share|improve this answer
    
I will just rename the objects once the restore is done. Thanks! –  ban-G Jan 18 '12 at 16:03
add comment

No you can not change an object name (other than the actual database) when you restore the database. You'll have to wait for the database to be restored and brought online (WITH RECOVERY) before you can change object names. If the object was renamed in the source database and you are rolling the logs forward the object will automatically be renamed as the logs are rolled forward.

share|improve this answer
    
thanks mrdenny. –  ban-G Jan 18 '12 at 16:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.