Ask, SQL SERVER derived Excel problem

The 1 was in the SQL SERVER server set a stored procedure, VC client to query and export to excel. through the ADO stored procedure call
But the stored procedure on the server will only in the server hard drives are excel.
I want to realize how to do in the client from Excel?
How will the returned records set derived excel.?

2 I for not calling a stored procedure, exec BPC in the VC command. But the implementation is not through, said there is a syntax error, how to return a responsibility?
For example: this statement in the query analyzer can: "EXEC master..Xp_cmdshell'bcp select * from xiang.. Queryout c:\ commodity" warehouse.Xls -c -q -S"LB-201309261256" -U"sa" -P"seny223"'

But how do I change in the VC, the SQL statement complex:
strsql="Complex SQL statements";

CStrin s=s="EXEC master..xp_cmdshell 'bcp '"+strsql+"' queryout 'C:\ commodity.Xls' -c -q -S'LB-201309261256' -U'sa' -P'seny223''";

This would suggest that there is a syntax error in the vicinity of queryout.
What's the matter. How to solve ah.

Started by Hugo at December 16, 2016 - 8:14 AM

The second question I just solved.
But it. Exec BCP derived excel. not the column headings, date fields will not show up. To manually adjust.
How to solve it?

Posted by Hugo at December 27, 2016 - 8:25 AM

Use the SSIS import and export directly, relatively simple

Posted by Sonia at January 08, 2017 - 9:04 AM