我正在编写一个批处理文件,只需运行MySQL脚本并将结果解压缩到csv文件中。但是在批量脚本运行之后没有任何反应,任何人都可以提供帮助吗?
@echo off
set batch_name=Test
set today=%date:~10,4%%date:~4,2%%date:~7,2%
set today_day=%date:~7,2%
set today_year=%date:~10,4%
set today_month=%date:~4,2%
set log_file=C:\Temp_%today%.log
sqlcmd -S servername -d dbname -U username -P xxxxx -i C:\temp\Script.sql"
-o C:\Temp\Result.csv -w
答案 0 :(得分:0)
试试这个
@echo off
set batch_name=Test
set today=%date:~10,4%%date:~4,2%%date:~7,2%
set today_day=%date:~7,2%
set today_year=%date:~10,4%
set today_month=%date:~4,2%
set log_file=C:\Temp_%today%.log
sqlcmd -S servername -d dbname -U username -P xxxxx -i C:\temp\Script.sql >> C:\Temp\Result.csv