Results 1 to 6 of 6

Thread: isql and query string

  1. #1
    Join Date
    May 2009
    Posts
    2

    isql and query string

    Hello,

    I am using isql to execute a query string from a batch file.

    This is the string:
    SET strg="SELECT * FROM tbtest"
    isql -d%DB% -U%User% -P%Pwd% -e -Q %strg% -m-1 -b

    and it worked in my pc, but I tried to execute it in another pc, and didn't work. It says "Error in '-Q'." and the -Q parameter is not in the list of the machine.

    Does anyone know if is due to a version issue? or Is there any other parameter that works as -Q?

    Thanks in advance,

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    -Q should work. Do you have the same version of ISQL on your machine and erroring machine?

    How are you executing ISQL?. If you are doing it from query window then you need to call xp_cmdshell.

  3. #3
    Join Date
    Sep 2002
    Posts
    5,938
    Better to use osql.

  4. #4
    Join Date
    May 2009
    Posts
    2

    isql and query string

    How could I check the version? I have been looking for it, but I haven't found it.

    I am using ISQL through a batch file.

    I think, it could be the version, because I got the parameter list of both pcs, and they are different, in the machine error, is not -Q and I didn't find anything that can replace it (based on the parameter list).

    Do the ISQL and OSQL have the same parameters?

    Thanks a lot for your responses!

  5. #5
    Join Date
    Sep 2002
    Posts
    5,938
    Yes, ISQL and OSQL have the same parameters but connect to sql server with different provider.

  6. #6
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    ISQL is legacy utility and if you Sybase client in your machine, it will also have ISQL and parameters are different.

    Look for properties of ISQL.exe in explorer and see the version/vendor etc.

    OSQL is native SQL Server tool, so it should work better for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •