Solved

How to start the mssqlserver by using xp_cmdshell

Posted on 2007-03-17
4
669 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 142

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

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…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now