Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.57 KB

File metadata and controls

52 lines (40 loc) · 1.57 KB
title Log In to an Instance of SQL Server (Command Prompt) | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql
ms.prod_service high-availability
ms.reviewer
ms.suite sql
ms.technology configuration
ms.tgt_pltfrm
ms.topic conceptual
helpviewer_keywords
logins [SQL Server], named instance of SQL Server
log ins [SQL Server]
logins [SQL Server], default instance of SQL Server
command prompt [SQL Server], logins
logging in [SQL Server]
ms.assetid f67c11e3-c519-40c9-82c1-07efa9d9985e
caps.latest.revision 26
author MikeRayMSFT
ms.author mikeray
manager craigg

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

[!INCLUDEappliesto-ss-xxxx-xxxx-xxx-md] This topic describes how to test connectivity to an instance of [!INCLUDEssNoVersion], use the sqlcmd utility.

To log in to the default instance of SQL Server

  1. 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

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

    sqlcmd [ /E ] /S servername\instancename  
    
    

See Also

sqlcmd Utility
osql Utility