I am trying to make a Sybase isql call from Powershell. The SQL file is a simple “select count” for now. It works from a standard command prompt but fails in Powershell.
Command Prompt:
H:\>isql -SSomeServer -USomeUser -PSomePassword -DSomeDatabase -i\\path\to\sql\file\SomeFile.sql
-----------
81210
(1 row affected)
Powershell:
PS H:\> isql -SSomeServer -USomeUser -PSomePassword -DSomeDatabase -i\\path\to\sql\file\SomeFile.sql
Unable to open input file '\\path\to\sql\file\SomeFile'.
I have tried putting single and double quotes around the file, but that results in a continued prompt (>>).
Does anyone know why this fails?
You need to wrap the entire last parameter with single-quotes:
isql -SSomeServer -USomeUser -PSomePassword -DSomeDatabase '-i\\path\to\sql\file\SomeFile.sql'