Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Problem with varchar return value with osql Expand / Collapse
Author
Message
Posted Monday, June 9, 2008 4:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, June 9, 2008 6:30 AM
Points: 1, Visits: 3
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.
Post #513621
Posted Tuesday, March 8, 2011 2:07 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 13, 2014 12:12 PM
Points: 2, Visits: 156
Hi
I have the same issue. I get the same below error. Can someone help?

osql: Error converting exit value.
Post #1074643
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse