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
Posted Tuesday, October 29, 2013 10:53 PM


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 -

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



Group: General Forum Members
Last Login: Yesterday @ 8:26 AM
Points: 15,874, Visits: 30,159
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
SQL Server Execution Plans

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

Add to briefcase

Permissions Expand / Collapse