Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# SQL-Server TSQL
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 22-Feb-13 4:13am
Edited 22-Feb-13 6:21am
v2
Comments
Arun1_m1 at 22-Feb-13 9:29am
   
Are you trying to stop a named instance of SQL Server ?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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
  Permalink  
Comments
Shubh Agrahari at 22-Feb-13 9:33am
   
its not good to put solution more the once .....be care full for next time...
ThePhantomUpvoter at 22-Feb-13 9:35am
   
There is a bug that solutions are sometimes posted twice.
willington.d at 22-Feb-13 9:40am
   
Its not my problem Shubh Agrahari. Please report this to Code Project.
Thanks for your kind advice.
Shubh Agrahari at 22-Feb-13 9:43am
   
ya ok but there also a delete link that helps you to remove solution from your end ..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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 [command] [service name] ...
 
The option 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 <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...
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 410
1 OriginalGriff 230
2 DamithSL 175
3 Maciej Los 135
4 Dave Kreskowiak 120
0 OriginalGriff 7,740
1 DamithSL 5,694
2 Sergey Alexandrovich Kryukov 5,404
3 Maciej Los 5,061
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 23 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100