DAC Connection in SQL Server:
The DAC allows database administrators to connect to a SQL Server Instance and to execute T-SQL commands to troubleshoot and fix issues rather than rebooting the SQL Server which could lead to database corruption or other problems.
However, only one dedicated administrator connection is allowed at a time on SQL Server 2005 and later versions.
Using DAC with SQLCMD
You need to be a member of the sysadmin fixed server role in order to use this feature. The "-A" switch is used to specify that the user is trying to connect to SQL Server using the Dedicated Administrator Connection.
You need to be a member of the sysadmin fixed server role in order to use this feature. The "-A" switch is used to specify that the user is trying to connect to SQL Server using the Dedicated Administrator Connection.
check options:
open cmd and type sqlcmd /?
The syntax to use DAC is mentioned below.
SQLCMD -S [SQL Server Name] -U [User Name] -P [Password] -A
select @@servername
SQLCMD –S ANURAG\ANURAG2014 –U sa –P clover@123 -A
Using DAC with SQL Server Management Studio
You need to specify "ADMIN:" before the SQL Server Instance name when trying to connect to an SQL Server Instance to using DAC feature as shown in the snippet below.
You need to specify "ADMIN:" before the SQL Server Instance name when trying to connect to an SQL Server Instance to using DAC feature as shown in the snippet below.