Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
INSERT INTO #Prefix_PCAC_temp select rtrim(ltrim(replace(@str1,"'",null)))
在上面的行中,它显示错误无效列名'''。PLZ 为我提供任何解决方案。
使用它来防止不正确的语法错误:
INSERT INTO #Prefix_PCAC_temp select rtrim(ltrim(replace(@str1,'''',null)))
但是,如果您的变量中有'符号,则该值将变为. 你很可能想要这个:@str1NULL
'
@str1
NULL
INSERT INTO #Prefix_PCAC_temp select rtrim(ltrim(replace(@str1,'''','')))
上面的查询从变量中消除'符号@str1并将值插入到表中