cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Andy_333
Level 3

Best way to check if SQLCMD is present on target machine?

Just as the title says, I'm looking for a best way for installation to check if sqlcmd is present on target machine. If not, it should be installed. I thought about several solutions, but they all have flaws. Here's my thoughts about this, in hope someone could provide a piece of advice what is best to do:
To create a specific prerequisite for SQLCMD (from command-line utilities microsoft provides, for example), we need to check if sqlcmd utility present in target machine. Unfortunately, every next version of SQL has different folder/registry path for Binn/Tools, which contains this utility. But installshield "prerequisite conditions" dialog seems to be not flexible enough in that case.
Second way would be to simply check for latest version of Command-line utilities and force user to install them if not. Looks simple, but not really considerate, is this really the only way?
Maybe, someone have met this problem before and could help with advice.
Labels (1)
0 Kudos
(1) Reply
rguggisberg
Level 13

SQLCMD /?
If error code returned is 0 SQLCMD is present. If not, it is not installed.
0 Kudos