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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Good call Q. I thought the batch was echoing the SQLCMD and so repeating; however, your theory sounds more viable.
ASKER
Thanks for the suggestions. I've had jury duty all week so I will try the suggestions on Monday.
ASKER
This resolved my problems. Thanks for your help.
Did you turn the echo off? If not, do so:
Open in new window
MSDN: http://msdn.microsoft.com/en-us/library/ms180944.aspxLet me know if that helps.