我想在bcp queryout命令的select子句中重命名列名。我尝试了下面的变体,但都不起作用。我想将第一列和第三列分别重命名为email_address和id。我在一个批处理脚本中调用bcp命令。bcp "select email as 'email_address', first_name, p_id as 'id' from table_name" queryout 15Days.txt-c -Ss
SET @query='bcp Staging.DBO.MSP_Tin_Reference_Response_FileImport in '+@TinResponseFilePath+@TinResponseFileNameS1000, NativeError = 0
Error = [Microsoft][SQL Server Native Client 10.0]Unexpected EOF encountered in BCP
我似乎找不到正确的语法来使用sql server management studio.I中的exec xp_cmdshell bcp导出带有列名的数据。EXEC xp_cmdshell bcp "select "a_id","b_id","c_id" union select a_id,b_id,c_id from tablename out '\\network_path\