startup sql in -m error

  • Wanted to try to startup sql server with a parameter to limit what can connect.  Got this from Microsoft site but it says invalid parameter.

    -m"Microsoft SQL Server Management Studio - Query"

  • hi,

    The parameter -m is to start the SQL Server engine service in single-user mode, it doesn't work with SSMS.

    I think you are mistaking one thing with the other and its really common, SQL Server Management Studio is the tool provided by Microsoft to manage SQL Server instances, SQL Server Engine is the relational database management system.

    Database Engine Service Startup Options

    If you are trying to use the parameter -m in the startup be aware of the next:

    You won't be able to use SSMS as smoothly as you usually do since only one user can connect to the instance and SSMS uses at least 2 sessions, one for the query text editor and the other for the object explorer.

    Most of the times i start with the -m parameter i usually use the sqlcmd.

    sqlcmd Utility

    regards,

  • Alejandro, if you read the documentation you will see that the example given is indeed on the MS documentation as an option to start SQL Server on single mode and allowing a specific application alone to connect.

    For example, -m"SQLCMD" limits connections to a single connection and that connection must identify itself as the SQLCMD client program.
    Use this option when you are starting SQL Server in single-user mode and an unknown client application is taking the only available connection.
    To connect through the Query Editor in Management Studio, use -m"Microsoft SQL Server Management Studio - Query".

    to the OP - can you tell us what is the exact command line you used - and if you did change on the service tab can you post the details and position of that line

     

  • I truly didn't knew that Frederico, thanks.

  • In the documentation at the bottom says to change - with these / in CMD.

    this one worked for me tcroninlifepoint:

    "C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn\sqlservr" /s MSSQLSERVER /m"Microsoft SQL Server Management Studio - Query"

    Service is up and could connect through SSMS query editor, attached photo.

    Thanks Frederico!

    Edit:

    After reading the docs, looks like you cant configure SSMS Query editor in the configuration manager, at the end in the -mApplicationName paragraph says:

    The SSMS Query Editor option cannot be configured by using SQL Server Configuration Manager because it includes the dash character which is rejected by the tool.

    but you can through CMD.

    Attachments:
    You must be logged in to view attached files.
  • I can restart but using your startup command I can't get to it through SSM

    tells me only one user can login it a time and refuses login

     

  • 1st) You gotta be quick otherwise you won't be able to connect to the instance (even though it should only support query editor connections) and would need to stop the service and start it again.

    2nd) Make sure you are connecting only using the query editor (According to the documentation), in SSMS > file ->new -> databse engine query -> right click and connect to the instance. it wont work the normal way since ssms will usually try to make different connections and while using the startup parameter -m it only supports one admin connection.

  • You can make up your own application name for the -m parameter and provide this in the connection options in SSMS. That way no one else can use up your connection.

    When you connect a query in SSMS open the Options Tab, go to “Additional Connection Properties” and add

    Application Name = <YourAppName>

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply