quotename函数的语法为:quotename('expression1','expression2')

expression1:指的是需要被特殊处理的字符

expression2:例如{}、[]等之类的字符

实际例子:

select quotename('aa','{}')  

----输出结果:{aa}

select quotename('aa','[]')  

----输出结果:[aa]
select quotename('aa','""')  

----输出结果:"aa"
select quotename('aa','()')  

----输出结果:(aa)

该函数一般在动态SQL拼接中会被使用到。

相关文章:

  • 2022-12-23
  • 2022-02-28
  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-06-29
  • 2022-12-23
猜你喜欢
  • 2022-02-02
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-12-21
相关资源
相似解决方案