Escaping special symbols in Sqlcmd

后端 未结 2 1204
有刺的猬
有刺的猬 2021-01-23 11:10

I have a bat file which executes bunch of sql scripts when i install my application. In installation dialogs user sets dbname, login and password which are then used in this bat

相关标签:
2条回答
  • 2021-01-23 11:24

    You need to escape the percent (%) character and the caret(^) character by doubling them. Here is a list of problematic command line characters

    SET _pswr="!#$%%^^&*()<>"
    
    0 讨论(0)
  • 2021-01-23 11:40

    Tested as well with windows batch file on Windows 2008 Server SP2 with sqlcmd. Only needed to escape the % sign as %%. No need to escape the ^.

    0 讨论(0)
提交回复
热议问题