从 DOS/Windows 批处理文件运行 Sybase SQL 命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1453079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Running Sybase SQL commands from DOS/Windows batch file
提问by Nemo
Is there any way I can run Sybase SQL commands from command prompt. I need to write a batch file which runs an SQL query on machine as a fix for a bug.
有什么方法可以从命令提示符运行 Sybase SQL 命令。我需要编写一个批处理文件,它在机器上运行 SQL 查询以修复错误。
回答by David Andres
Use ISQL. See http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.utility/html/utility/utility10.htmfor the complete reference.
使用 ISQL。有关完整参考,请参见http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.utility/html/utility/utility10.htm。
Specifically, you're looking for commands like this:
具体来说,您正在寻找这样的命令:
ISQL -S server -D database -U user -P password
This will launch ISQL with the indicated settings, and from there you can run SQL statements against the database.
这将使用指定的设置启动 ISQL,然后您可以对数据库运行 SQL 语句。