Need help to make sqlcmd run as per requirements

  • 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.

  • Open a command window and try running the command directly from there. That will allow you to see the window and error messages as they occur. Another option is to use -o outputfile option. That will allow you to capture the output of the command into the file that you define after the -o. That's an "oh", not a zero.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply