T-sql 脚本中 $(美元符号)的转义序列 [英] Escape sequence for $ (dollar sign) in T-sql script

查看:33
本文介绍了T-sql 脚本中 $(美元符号)的转义序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个从 powershell 脚本调用的 T-SQL 脚本,其中包含一个文本行,其中包含一个包含 $(MV) 的序列.

I am running a T-SQL script, called from a powershell script, that contains a text row which includes a sequence containing $(MV).

当我运行脚本时,我收到错误'MV' 脚本变量未定义."我认为这是因为它将 $(MV) 字符串解释为变量而不是文本字符串的一部分.

When I run the script I get the error "'MV' scripting variable not defined." which I assume is because it interpretates the $(MV) string as a variable instead of being a part of the text string.

如何将美元符号写为转义序列?这可能在字符串中吗?

How can I write the dollar sign as an escape sequence? Is that possible in a string?

推荐答案

您可以在 PowerShell 中使用反引号字符来转义 $ 符号:

You can use the backtick character to escape a $ sign in PowerShell:

`$

这篇关于T-sql 脚本中 $(美元符号)的转义序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆