语法错误BCHF_VOU_NUM +''+ BCHF_VOU_DTE
set @m_sql = 'Select distinct BCHF_VOU_NUM, BCHF_VOU_DTE, BCHF_E_AMT, NACD_DES,
(BCHF_VOU_NUM +' '+ BCHF_VOU_DTE +' '+BCHF_E_AMT +' '+NACD_DES) as name,
dbo.E_DOC_NUM_2_CHEQUE_NO(BCHF_E_DOC_NUM) FROM ' + @ParaCoCode + '..BCH' + @ParaBatchNo + ' abc inner join v_AnalysisCode on BCHF_E_ANA_CDE1 = ANACode inner join
Project_TR_TP_COM_Test.dbo.FlexAccount zz ON zz.CurrentAccountID = (Select
CurrentAccountID from Batch where'
答案 0 :(得分:5)
要在SQL中转义单引号,必须使用相同的字符两次。 ''
将替换为连接字符串中的单引号。