We've got a couple of scripts that we routinely run on several SQL
servers, and they usually run fine. But we're trying to run them on one
particular server, and we're running into problems. I'm no expert with
SQL, but two DBA's who I work with have spent hours on this and they're
stumped, so I don't feel so stupid. Maybe someone here can help.
Basically, we've got a .bat file that calls a .sql file. Within the
..bat file, isql is called a couple of times with no problems. Within
the .sql file, there are several lines like:
exec master..xp_cmdshell @@cmd
@@cmd has previously been defined as a text string that begins with
isql.
Whenever this runs, we get the error:
'isql' is not recognized as an internal or external command,
operable program or batch file.
In other words, it can't find the file isql.exe.
We already made sure that the Windows PATH variable for the user
running the .bat file includes the folder that has isql.exe in it.
Someone said that they once had a problem where that folder had to be
the first folder in the PATH variable in order to recognize isql, so we
even made that change (and logged off and back in, then checked the
path from a DOS prompt to make sure the change took effect).
Anyone know anything else to check that would explain why our sql
script would be unable to find the isql.exe command? Any help would be
greatly appreciated.
--Richard