I thought we could run sqlcmd commands directly in the Query Editor within
Management Studio by clicking on the SQLCMD mode
So for example I tried this
sqlcmd -d userdb -i test.sql
in the query editor and it failed. However it succeeds when I run it from
the command prompt
Thankssqlcmd is not a sqlcmd command. It is a command understood by the *Operating System* command
interpreter, which *starts* sqlcmd. SSMS does understand sqlcmd commands, like :r and :Connect
provided you set SSMS in that mode (check the Query menu).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Hassan" <hassan@.test.com> wrote in message news:OTiUrmrOIHA.4712@.TK2MSFTNGP04.phx.gbl...
>I thought we could run sqlcmd commands directly in the Query Editor within Management Studio by
>clicking on the SQLCMD mode
> So for example I tried this
> sqlcmd -d userdb -i test.sql
> in the query editor and it failed. However it succeeds when I run it from the command prompt
> Thanks
Monday, March 12, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment