This article describes how to set the SQLCMD utility path to point to its installation folder.
Note: This article is applicable for SQL server agents 4.6.5 and earlier.
Why set the SQLCMD utility path
The SQLCMD utility is an out-of-the-box command-line utility that comes with SQL servers 2005 and later. The SQLCMD utility allows you to execute Transact-SQL statements and scripts that are ad-hoc and interactive in nature. This execution is similar to working at the command prompt. To know more about the SQLCMD utility, see this article in the Microsoft library.
To ensure that backups and restores from your SQL servers complete successfully, you must ensure that the system variable path for SQLCMD utility is set to point to the installation of the SQLCMD utility. At the time of a backup or restore, if Phoenix cannot find this path, backups or restores will fail. To avoid this issue, manually set the SQLCMD environment variable path to point to the installation folder of this utility.
Before you begin
Before setting the SQLCMD path, ensure that you have the full path to the utility.
- For SQL Server 2012, the path is: <drive>:\Program Files\Microsoft SQL Server\100\Tools\Binn
- For SQL Server 2008, the path is: <drive>:\Program Files\Microsoft SQL Server\110\ Tools\Binn
To set the SQLCMD utility
- Navigate to Control Panel > System and Security > System.
- Click Change settings.
- Click the Advanced tab.
- On the System Properties window, click Environment Variables.
- Under System Variables, click New.
- On the New System Variable window, type a name for this system variable in the Variable Name box, and in the Variable value box, type the path to the SQLCMD utility.
- Save your changes.