We're in the proces of preparing our migration to our new servers aswell as SQL 2012 and everything is looking fine and dandy and i'm testing some of the scripts we will be using.
One of these scripts grabs all the full backups in a specfic folder and restores the databases. It looks at the Database name specified in the HEADER information of the specific backup files.
Now we've got atleast one database which some genius deceided to somehow copy from an old database, and then rename or something. (Don't ask me exactly what he/she did) When the script get's to this database it attempts to restore it with the old name. As the old database is still in use and already restored the script fails here and goes to the next database which is fine.
How ever before our migration i'd like to actually change the name of this database so it's reflected in the HEADER information so that this script works on it's own. (Yes, I know I can make the code skip this database and simply restore this one manually later).
Is there any way to check the headerinformation of a live database and change it?