﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Randy Dyess / Article Discussions / Article Discussions by Author  / Problem with varchar return value with osql / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 19 Jun 2013 04:54:39 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Problem with varchar return value with osql</title><link>http://www.sqlservercentral.com/Forums/Topic513621-84-1.aspx</link><description>Hi     I have the same issue.  I get the same below error.  Can someone help?osql:  Error converting exit value.</description><pubDate>Tue, 08 Mar 2011 02:07:39 GMT</pubDate><dc:creator>VickyWinner</dc:creator></item><item><title>Problem with varchar return value with osql</title><link>http://www.sqlservercentral.com/Forums/Topic513621-84-1.aspx</link><description>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. :(</description><pubDate>Mon, 09 Jun 2008 04:55:21 GMT</pubDate><dc:creator>abdel-774383</dc:creator></item></channel></rss>