Link to home
Start Free TrialLog in
Avatar of bnob99
bnob99

asked on

SQLCMD not executing correctly when using a batch file

I'm trying to backup a small SQL database using task scheduler in Windows 7.  When I run the SQL command that I have created in the command prompt, it runs successfully.  If I try and run that same command in a batch file, the command just executes over and over in the command prompt until you cancel it.  What am I missing?  I am using SQL Server Express 2008.
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Hi.

Did you turn the echo off? If not, do so:
@echo off

Open in new window

MSDN: http://msdn.microsoft.com/en-us/library/ms180944.aspx

Let me know if that helps.
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good call Q. I thought the batch was echoing the SQLCMD and so repeating; however, your theory sounds more viable.
Avatar of bnob99
bnob99

ASKER

Thanks for the suggestions.  I've had jury duty all week so I will try the suggestions on Monday.
Avatar of bnob99

ASKER

This resolved my problems.  Thanks for your help.