質問

I wanted to run SQLCMD.EXE as mentioned here - http://blog.daringa.com/archives/tag/error-hresult-e_fail-has-been-returned-from-a-call-to-a-com-component

I used the line in link with proper path to sqlcmd, user and password I use to login to my SQL server - sqlcmd -S .\MYSQLSERVER2008 -U MyUsername -P MyPassword -i C:\Database\hugescript.sql

Problem - I see a window and some message, but it vanishes so quickly that I cannot even see what it is. How do I see this window and how do I then execute an SQL file via SQLCMD.EXE

Why am I executing a script via SQLCMD and not SQL SERVER (ie SS) MGMT STUDIO ? SS throws an error when sql files are big, ie about 100mb or more.

役に立ちましたか?

解決

You can redirect the output from sqlcmd

sqlcmd -S .\MYSQLSERVER2008 -U MyUsername -P MyPassword 
-i C:\Database\hugescript.sql > log.txt 2> error.txt

It will write the output to log.txt file and errors to error.txt file (you can specify the full path if you want). You can then see what's happening.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top