Problem with varchar return value with osql

  • Hi everybody,

    I'm trying to insert an osql command within a DOS batch file (which contains DOS commands) :

    osql -S Server -U User -P PassWord -Q "select top 1 column1 from table1 a, table2 b where b.id=a.id"

    I would like to use the value of the column1 in the continuation of my batch file.

    I tried by using exit :

    osql -S Server -U User -P PassWord -Q "exit(select top 1 column1 from table1 a, table2 b where b.id=a.id)"

    But my problem is that the column1 is not an integer but a varchar, so I have an error message :

    osql: Error converting exit value.

    Any idea ? Many thanks for your help. 🙁

  • Hi

    I have the same issue. I get the same below error. Can someone help?

    osql: Error converting exit value.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply