Reputation: 10448
I want to change the location of sqlcmd.exe from its default place to my desired one. Can I place it in my project directory for example?
Upvotes: 0
Views: 4646
Reputation: 23
Fraz, I have tested the following, and it works fine:
Remove both SQLCMD.exe and SQLCMD.rll from their current folders and place them in the directory you'd like to run SQLCMD.exe from. The RLL file is, by default, found in the Tools\Binn\Resources folder of the Microsoft SQL Server Program Files folder. These are the only two files that are required for SQLCMD.exe to work, and the RLL file doesn't have to be in a Resources folder in the new location (it can be in the same directory as SQLCMD.exe).
Once you have done the above, you must add the new location to the Path Environment Variable in Windows. On Windows 7, you can access the Environment Variables dialog by navigating to Control Panel\System and Security\System, clicking on Advanced system settings, and pressing Environment Variables on the Advanced tab of the resulting dialog box. Once in that dialog, look for the Path variable, under the System variables heading; once you've found that, select it, click Edit, and add the new location of SQLCMD.exe to the end of the current value in the Variable value box, preceding it with a semicolon.
Please let me know if you would like anything explained further or you have any questions about this answer. I could help you find the Environment Variables dialog on other versions of Windows, if you'd like.
Upvotes: 0
Reputation: 11820
Try move Resources
(it is in same dir where sqlcmd.exe is) folder and sqlcmd.exe
together. My guess sqlcmd.exe
using resources from that folder.
Upvotes: 1
Reputation: 899
You can create a .bat file which changes working directory to your desired path and then passes received arguments to sqlcmd.exe.
Upvotes: 1