riswana (11/1/2012)
Hi,I am having the same problem. My query string is greater than 8000 characters. I am using varchar(max).
Can someone assist urgently with a result, please.
On computers running Microsoft Windows XP or later, the maximum length of the string that you can use at the command prompt is 8191 characters.
so you need to shorten up whatever is being passed as a query to your bcp.
use the query string to insert the data into a view, and use bcp to select from the view instead.
see this very similar post, where the Original poster needed to change his bcp query to select from a view(or global temp table):
http://www.sqlservercentral.com/Forums/FindPost1378950.aspx
Lowell