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
Solved

How to start the mssqlserver by using xp_cmdshell

Posted on 2007-03-17
4
675 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
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

839 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