osql,isql和sqlcmd有什么区别? [英] What are the differences between osql, isql, and sqlcmd?

查看:1169
本文介绍了osql,isql和sqlcmd有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣为SQL Server使用类似于Oracle SQL * Plus的某种命令行实用程序。 SQL Server似乎有几个选项:osql,isql和sqlcmd。但是,我不太确定要使用哪一个。

I am interested in using some kind of a command-line utility for SQL Server similar to Oracle's SQL*Plus. SQL Server seems to have several options: osql, isql, and sqlcmd. However, I am not quite certain which one to use.

它们本质上都做同样的事情吗?

Do they all essentially do the same thing? Are there any situations where it is preferable to use one over the others?

推荐答案

使用sqlcmd - 它是最全面的产品

Use sqlcmd-- it's the most fully featured product.


  • sqlcmd :SQL Server最新的最好的命令行界面。

  • isql :旧的DB-Library(本机SQL Server协议)与SQL Server的命令行通信方式。

  • osql :旧的,基于ODBC的与SQL Server的命令行通信方式。

  • sqlcmd: The newest, fanciest command-line interface to SQL Server.
  • isql : The older, DB-Library (native SQL Server protocol) way of command-line communication with SQL Server.
  • osql : The older, ODBC-based way of command-line communication with SQL Server.

从几年前我回答这个问题以来,时间已经改变。现在,您还可以在PowerShell中使用 invoke-sqlcmd cmdlet。如果你习惯于PowerShell或计划做任何复杂的任何脚本,请改用它。

Times have changed since I replied on this a couple of years ago. Nowadays, you can also use the invoke-sqlcmd cmdlet in PowerShell. If you're used to PowerShell or plan to do any scripting of any sophistication, use this instead.

这篇关于osql,isql和sqlcmd有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆