Article ID: 952734 - View products that this article applies to.
Consider the following scenario. In Microsoft SQL Server 2005, you have a stored procedure that contains a dynamic query. In the stored procedure, the EXEC statement runs the dynamic query. To copy the result set of the stored procedure, you run the bcp utility together with the queryout option. In this scenario, you receive the following error message:
SQLState = S1000, NativeError = 0 Error = [Microsoft][SQL Native Client]
BCP host-files must contain at least one column
To work around this problem, do not use a dynamic query in a stored procedure when you run the bcp utility together with the queryout option.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Steps to reproduce the problem
Article ID: 952734 - Last Review: May 30, 2008 - Revision: 1.1