Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to stop and start sql server instance using command line?
i`v trid following samples:
net stop MSSQLSERVER
and
net stop "SQL Server Agent (MSSQLSERVER)"
but after hitting this the cmd windows comes for a second and dissapears and the nothing happens to sql server named instance...


thanks...
Posted
Updated 22-Feb-13 5:21am
v2
Comments
Arun1_m1 22-Feb-13 9:29am    
Are you trying to stop a named instance of SQL Server ?

Hi Sakura

Go to Command prompt
Run -> type cmd to to command prompt

To Start SQL Server
net start mssqlserver

To Stop SQL Server
net stop mssqlserver

Regards
Willington
 
Share this answer
 
Hi Sakura

Go to Command prompt
Run -> type cmd to to command prompt

To Start SQL Server
net start mssqlserver

To Stop SQL Server
net stop mssqlserver

Regards
Willington
 
Share this answer
 
Comments
Shubh Agrahari 22-Feb-13 9:33am    
its not good to put solution more the once .....be care full for next time...
[no name] 22-Feb-13 9:35am    
There is a bug that solutions are sometimes posted twice.
willington.d 22-Feb-13 9:40am    
Its not my problem Shubh Agrahari. Please report this to Code Project.
Thanks for your kind advice.
Shubh Agrahari 22-Feb-13 9:43am    
ya ok but there also a delete link that helps you to remove solution from your end ..
Hi professional...

there is such a many commands for driving sql server throw command prompt ...

DESCRIPTION:
SC is a command line program used for communicating with the
NT Service Controller and services.
USAGE:
sc <server> [command] [service name] ...

The option <server> has the form "\\ServerName"
Further help on commands can be obtained by typing: "sc [command]"
Commands:
query-----------Queries the status for a service, or
enumerates the status for types of services.
queryex---------Queries the extended status for a service, or
enumerates the status for types of services.
start-----------Starts a service.
pause-----------Sends a PAUSE control request to a service.
interrogate-----Sends an INTERROGATE control request to a service.
continue--------Sends a CONTINUE control request to a service.
stop------------Sends a STOP request to a service.
config----------Changes the configuration of a service (persistant).
description-----Changes the description of a service.
failure---------Changes the actions taken by a service upon failure.
qc--------------Queries the configuration information for a service.
qdescription----Queries the description for a service.
qfailure--------Queries the actions taken by a service upon failure.
delete----------Deletes a service (from the registry).
create----------Creates a service. (adds it to the registry).
control---------Sends a control to a service.
sdshow----------Displays a service's security descriptor.
sdset-----------Sets a service's security descriptor.
GetDisplayName--Gets the DisplayName for a service.
GetKeyName------Gets the ServiceKeyName for a service.
EnumDepend------Enumerates Service Dependencies.

The following commands don't require a service name:
sc <server> <command> <option>
boot------------(ok | bad) Indicates whether the last boot should
be saved as the last-known-good boot configuration
Lock------------Locks the Service Database
QueryLock-------Queries the LockStatus for the SCManager Database
EXAMPLE:
sc start MyService

and for many more sql operation try this link..

http://msdn.microsoft.com/en-us/library/ms165702%28v=sql.105%29.aspx[^]

happy to help...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900