From this article, I know to that slash (/) is used instead of a hyphen (-) when a net start is used with startup option,

net start mssqlserver /m

But if I want to have to use with startup option limit to an application, for example sqlcmd (-m"SQLCMD"), how do I do that with NET START?


For the article you linked it references the specific start up options used by the Database Engine ("sqlservr.exe"). So the "-" dash is used as stated in the article. This article points to the method used in a DOS prompt to start SQL Server in single user mode. I believe using /m"SQLCMD" would work the same way, but I normally use the commands noted below.

So from a DOS prompt, the command to start SQL Server default instance in single user mode and only allow SQLCMD to connect would be:
sqlservr.exe -m"SQLCMD"

If you have a named instance it would be:
sqlservr.exe -m"SQLCMD" -s MyServer\MyInstance

| improve this answer | |
  • The article I linked actually shows how to use net start with start option using (/). I must have used backslash (it was late night) and didn't work. /m"SQLCMD" works fine. Thanks for the article, learn something new. – Travis Oct 19 '13 at 16:48
  • I don't see that in the link from your question, unless I am reading over it. May need to double check what article you are referencing, just for those that find this question. – user507 Oct 19 '13 at 19:42
  • At 'Using Startup Options for Troubleshooting' toward the bottom of the page. – Travis Oct 19 '13 at 22:06

NET START will start a service. You can't limit the connection to SQLCMD. What you can do is limit connection using another way. You can use the SQL Server Configuration Manager to block all network connections by disabling TCP-IP and Named-Pipes protocol. This way only someone connected to the local machine (Shared Memory) would be able to connect.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.