[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 643
  • Last Modified:

SQLAGENT DOS Window stays open

When we run the Service SQLAGENT a DOS windows opens and stays open.
If we close it, the service stops.

Can anyone help?
0
glenn_1984
Asked:
glenn_1984
  • 3
  • 2
  • 2
  • +2
1 Solution
 
mcp111Commented:
in enterprise manager, open the management node, right-click on sql server agent and choose Start.
0
 
RDWaibelCommented:
Did a little research on it.  If you start the agent in a dos window, that dos session controls the agent.

sqlagent Application
The sqlagent application starts SQL Server Agent from the command prompt. Usually, SQL Server Agent should be run from SQL Server Service Manager or by using SQL-DMO methods in an application. Only run sqlagent from the command prompt when you are diagnosing SQL Server Agent, or when you are directed to by your primary support provider.

Syntax
sqlagent -c [-v]

Arguments
-c
Indicates that SQL Server Agent is running from the command prompt and is independent of the Windows NT Service Control Manager. When -c is used, SQL Server Agent cannot be controlled from either the Services application in Control Panel or SQL Server Service Manager.
-v
Indicates that SQL Server Agent runs in verbose mode and writes diagnostic information to the command-prompt window. The diagnostic information is the same as the information written to the SQL Server Agent error log.
Remarks
After displaying a copyright message, sqlagent displays output in the command-prompt window only when the -v switch is specified. To stop sqlagent, press CTRL+C at the command prompt. Do not close the command-prompt window before stopping sqlagent.

mcp111 is correct.  OR you can start it via the services on the SQL server.

=)  Rob
0
 
wyckedone1Commented:
Stop the SQL Agent.  Go into your Services menu and:

1. Double-click the SQLAgent service
2. Click on the Log On tab
3. Take the check mark off from "Allow service to interact with desktop"
4. Restart agent.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
MichaelSFullerCommented:
Not correct, do this:

1)Open up Notepad
2)Paste this in:
   net start SQLSERVERAGENT

3) Save it as a batch file .bat extension

4) Double click or schedule it as a windows task to run.


Hope this helps...


-Late


 
0
 
glenn_1984Author Commented:
wyckedone1 -- "Interact with desktop" is already checked.
MichaelSFuller -- net start still leaves DOS box open
0
 
glenn_1984Author Commented:
Correction... wyckedone1 -- your answer WAS correct. Thanks
0
 
MichaelSFullerCommented:
How? I do this everyday on a NAS, because of the UNC path problem, with SQL Server 2000.
0
 
wyckedone1Commented:
MichaelSFuller: The way you described still starts the service which is controlled by the Services menu.  If you look at the service (in the Services menu), and it is set to interact with the desktop (i.e. step 3 in my answer), it will show the DOS window.  Removing that check mark does not allow the service to interact with the desktop.  Using the "net start" command is just a quicker way than going into the Services menu, right-clicking and choosing to start the service or starting the SQLAgent service using the Service Control Manager.
0
 
MichaelSFullerCommented:
I misunderstood the question, from RDWaibel comments I thought they were trying to run the agent from a command prompt, and it was leaving the window open. For example when you do a nightly restart of SQL Server 2000, for cold snapshots on a NAS, or SAN or becasue of memory leaks on the server.



-Late


0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now