Export (0) Print
Expand All

Log In to an Instance of SQL Server (Command Prompt)

This topic describes how to test connectivity to an instance of SQL Server, use the sqlcmd utility.

To log in to the default instance of SQL Server

  • From a command prompt, enter the following command to connect by using Windows Authentication:

    sqlcmd [ /E ] [ /S servername ]
    

To log in to a named instance of SQL Server

  • From a command prompt, enter the following command to connect by using Windows Authentication:

    sqlcmd [ /E ] /S servername\instancename
    

Arrow icon used with Back to Top link [Top]

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft