我正在编写一个批处理文件来简单地运行 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
最佳答案
试试这个
@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
关于mysql - 将 SQL 结果提取到 CSV 文件批处理作业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47528019/