Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Capture output of sqlcmd before shutdown services
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

594 Posts

Posted - 12/07/2013 :  22:17:37  Show Profile  Send TRACEYSQL an ICQ Message  Reply with Quote
I have a bat file, which I run the statement sqlcmd -S Sqlservername -E -Q "select STATUS from MYDATABASE.DBO.CONTROLLOG" -o d:\scripts\testoutput1.txt -e

Once captured the output
if the status is COMPLETE, then I can restart some application services.

How do I capture the status in a variable so I can do
----The start part works, I have this in a bat file too
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000