Call 855-644-2677 for Microsoft Dynamics GP / SL Support, Training, and Implementation

How to Change the Logical File Names For SQL Databases in Microsoft Dynamics GP

January 6, 2016 10:39 pm Published by

How to Change the Logical File Names For SQL Databases in Microsoft Dynamics GPLast week, Microsoft MVP Ian Grieve discussed on his Azure Curve blog changing the logical file names of SQL databases in Microsoft Dynamics GP. When a SQL database is created, a logical name will be assigned to it, and that logical name will match the physical name. However, as Grieve points out, “When working with Microsoft Dynamics GP, we often create both a live and test database and then populate the settings in the live database and replicate over the top of the test one.”

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.”

About MIG & Co.

MIG & Co. is a professional consulting firm that specializes in the implementation of business management software solutions, including Microsoft Dynamics GP, SL, and CRM. We automate business processes to ensure that our customers work efficiently. MIG is a Microsoft Dynamics Gold Certified Partner.

Ready to learn how Microsoft Dynamics can help your business?

Talk to an Expert

Your privacy is important to us. MIG & Co. will never sell, lease, or share your information.

MIG & Co.