简体   繁体   English

禁用SQL Server 2008 Express

[英]Disabling SQL Server 2008 Express

I need to write a script that disables SQL Server Express 2008 from running. 我需要编写一个脚本来禁用SQL Server Express 2008的运行。 This script will be ran on about 500 machines. 该脚本将在约500台计算机上运行。 In my script, I'm setting the start up type for all SQL Windows Services to disabled, and then restart the machine. 在我的脚本中,我将所有SQL Windows Services的启动类型都设置为禁用,然后重新启动计算机。

In my mind, I have now 100% disabled SQL Server Express from running. 在我看来,我现在已100%禁止运行SQL Server Express。 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? 如果服务保持禁用状态,我是否已完全停止执行SQL Server Express?

if no service is running, then sql server is not running since sql server is made up from services. 如果没有服务在运行,则sql server不在运行,因为sql server由服务组成。

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: 要禁用SQL Express,请执行以下操作:

net stop MSSQL$SQLEXPRESS

To do this in C# you could do: 要在C#中执行此操作,您可以执行以下操作:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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