gpt4 book ai didi

SQLCMD :r where path is a variable

转载 作者:行者123 更新时间:2023-12-04 14:18:41 26 4
gpt4 key购买 nike

SQLCMD 命令 :r支持非常量文字路径?

例如:

setvar $(path1) '.\script.sql'
:r $(path1) -- SQL01260: A fatal parser error occurred: .
:r '$(path1)' -- SQL01260: A fatal parser error occurred: .
:r "$(path1)" -- SQL01260: A fatal parser error occurred: .

最佳答案

Does the SQLCMD command :r support non-constant literal paths?



确实如此。您以错误的方式定义了变量。尝试:
:setvar path1 "script.sql"
:r $(path1)

另见 this article on MSDN .

关于SQLCMD :r <path> where path is a variable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5653103/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com