0
大家好,我是新的批处理文件和挣扎。我正在使用sql server 2008如何将变量添加到批处理文件?
我已经创建了一个批处理文件,执行其他批处理文件+ sql脚本。 我想使用变量我该怎么做? 我想将路径设置为一个变量。 根据脚本的位置,我可以有多个路径。
:On Error exit
CALL C:\mypath\Scripts\ExecSqlScripts.bat
CALL C:\mypath\Scripts\ExecSqlScriptsTwo.bat
SQLCMD -S (Local) -i C:\mypath\Scripts\InsertUsernameTwo.sql
SQLCMD -S (Local) -i C:\mypath\Scripts\InsertUsernameThree.sql
SQLCMD -S (Local) -i C:\mypath\Scripts\InsertUsernameFour.sql
有什么建议吗?
等效这是一种享受。关于你更好的解决方案,我不理解它。我看到你在循环播放,但%% f让我困惑。可以解释一下。 – user9969 2010-10-02 10:33:42
for命令有很多很好的问题:http://stackoverflow.com/search?q=for+loop+batch – 2010-10-02 10:37:49