sql2005 是sqlcmd, sql2000 是oSQL?
它们后面跟的格式一样吗?
为沈默在sql2000 下在批处理文件中执行脚本不执行呢?
脚步如下:
oSQL -S Localhost -E -d "PatDB" -W -Q "select '数据库:' + [aa] from T_aa"如果在sql2005下,把上面脚本的oSQL改为sqlcmd是可以运行的。
它们后面跟的格式一样吗?
为沈默在sql2000 下在批处理文件中执行脚本不执行呢?
脚步如下:
oSQL -S Localhost -E -d "PatDB" -W -Q "select '数据库:' + [aa] from T_aa"如果在sql2005下,把上面脚本的oSQL改为sqlcmd是可以运行的。
比如
[code=BatchFile]sqlcmd -S Localhost -E -d "master" -Q "select count(*) from sysobjects" [/code]
[code=BatchFile]osql -S Localhost -E -d "master" -Q "select count(*) from sysobjects" [/code]