Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Need help to make sqlcmd run as per requirements Expand / Collapse
Author
Message
Posted Tuesday, October 29, 2013 10:53 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, May 15, 2014 8:51 PM
Points: 183, Visits: 480
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.
Post #1509649
Posted Wednesday, October 30, 2013 4:21 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 8:22 AM
Points: 14,205, Visits: 28,534
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
The Scary DBA
Author of:
SQL Server Query Performance Tuning
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1509703
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse