批量导出将双引号(“)添加到值

时间:2018-10-23 07:33:37

标签: sql sql-server tsql stored-procedures

我尝试在字段值前后添加双引号(“)。我的代码就像

ALTER procedure [dbo].[account_extension]
AS
Declare   @V_SQL_TMP     VARCHAR (4000)
SET @V_SQL_TMP = 
'bcp " SELECT "*" from [dbo].[in_account_extension] " queryout "C:\in_account_extension.txt" -c -UTF8 -t"|" -T -Slocalhost'
EXEC xp_cmdshell @V_SQL_TMP

结果返回为 AA | BB | CC。预期输出为“ AA” |“ BB” |“ CC”

0 个答案:

没有答案