
Another complicating example that Grieves offers is when you create a template database, which then gets copied when a new company is created. This method might be used if you have a substantial amount of setup in third party modules for which the PSTL Company Copy doesn’t work.
These two scenarios both lead to the same problem: when a database is restored elsewhere, it will bring its logical name with it, and that means that a mismatch between the logical and physical names will occur, which in turn causes problems when backing up and restoring databases.
But worry not, because you can change the logical name of a database with a simple SQL script. Use two “ALTER DATABASE” commands, one to change the name of the data file and another to change the name of the log file. Grieve reminds that “as always, when running a SQL script against a database, make sure you have a good backup and perform a test afterward to make sure there are no problems.”







