简体   繁体   中英

Disabling SQL Server 2008 Express

I need to write a script that disables SQL Server Express 2008 from running. This script will be ran on about 500 machines. In my script, I'm setting the start up type for all SQL Windows Services to disabled, and then restart the machine.

In my mind, I have now 100% disabled SQL Server Express from running. I don't care about the orphaned files, someday we might want to turn it back on, so for now, the files can remain.

My Question ...

Is there anything lurking behind that can run, that I'm not considering? Have I totally stopped SQL Server Express from executing, if the services remain disabled?

if no service is running, then sql server is not running since sql server is made up from services.

Why are you asking? Do you want to uninstall and it say that something cannot be deletet because the file is locked?

Try using

net stop "SQL Server (MSSQLSERVER)"

in the commandline if you do not want to unistall the service.

To disable SQL Express use:

net stop MSSQL$SQLEXPRESS

To do this in C# you could do:

string disableSQLExpress = "net stop MSSQL$SQLEXPRESS"; Process.Start("CMD.exe", disableSQLExpress);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM