【发布时间】:2011-08-10 17:49:57
【问题描述】:
我正在尝试将双引号传递给 SQLCMD 中的脚本变量。有没有办法做到这一点?
sqlcmd -S %serverName% -E -d MSDB -i MyScript.sql -m 1 -v Parameter="\""MyValueInDoubleQuote\"""
我的sql脚本如下:
--This Parameter variable below is commented out since we will get it from the batch file through sqlcmd
--:SETVAR Parameter "\""MyValueInDoubleQuote\"""
INSERT INTO [MyTable]
([AccountTypeID]
,[Description])
VALUES
(1
,$(Parameter))
GO
【问题讨论】:
标签: sql-server sqlcmd