3

I have several versions of SSMS installed on my machine. We have legacy servers running several versions of SQL Server, mainly 2008, 2012, and 2014. I use SQLCMD all the time, but it seems to default to the Version 10 version of the command.

C:\Program Files\Microsoft SQL Server100円\Tools\Binn

I need to use the one from the newer version for some of the new servers that don't have backwards compatibility enabled.

C:\Program Files\Microsoft SQL Server110円\Tools\Binn

What settings do I need to change so that I don't have to use the full path every time I want to use SQLCMD?

mustaccio
28.6k24 gold badges60 silver badges77 bronze badges
asked Mar 20, 2019 at 17:37

1 Answer 1

9

Have you tried updating the PATH variable?

For Windows 10, do the following:

  1. In the File Explorer, right-click on This PC.

  2. In the context menu, click Properties.

  3. In the System window, click the Advanced system settings page on the left-hand side.

  4. In the Advanced Tab, click on Environment Variables.

  5. In the System Variables window, highlight Path, and click Edit.

  6. In the Edit System Variables window, insert the cursor at the end of the Variable value field.

  7. If the last character is not a semi-colon (;), add one.

  8. After the final semi-colon, type the full path to the file you want to find.

    • In your case: C:\Program Files\Microsoft SQL Server110円\Tools\Binn
  9. Find the path with 100 in it, and then remove it.

Click OK in each open window.

Word of caution: After doing these steps, you will not be able to auto-find any other exe's that the system was able to find earlier in the older path you just removed.

answered Mar 20, 2019 at 18:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.