Solved

How to start the mssqlserver by using xp_cmdshell

Posted on 2007-03-17
4
679 Views
Last Modified: 2007-03-19
Hi,
How can I restart the mssqlserver and sqlserveragent in QA?
I try with this command exec master..xp_cmdshell 'net start msssqlserver' but there is an option Yes or not which I do not know how to enter the values
0
Comment
Question by:motioneye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 100 total points
ID: 18740461
>How can I restart ...
you cannot restart SQL Server from within itself. trying to do so would result in an error.
you could only try to schedule a restart using command line (at.exe) or vbscript file.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 18740471
Do this from the Command line:
net start MSSQLSERVER
net start SQLSERVERAGENT
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 18740476
Also, just friendly reminder but the following questions are now considered abandoned, please attend to them:
1 02/28/2007 500 sql server cou at 100% and wil... Open MS SQL Server
2 02/22/2007 500 SQL DTS error, how to troubles... Open MS SQL DTS
3 01/11/2007 500 How to find the root of blocki... Open MS SQL Server
0
 
LVL 16

Accepted Solution

by:
rboyd56 earned 400 total points
ID: 18740534
From a logical standpoint. SQL Server has to be rujning in order to connect via Query Analyzer. Therefore, you cannot start SQL Server using Query Analyzer, just as angellll indicated.

You can in fact stop SQL Server using Query Analyzer using the SHUTDOWN command
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question