Can anyone help me on below . I am trying to execute the SQLCMD with DAC (-A switch) but unable to do so .
How can I do it both ways below :
- Execute in SSMS Query Pane
- Execute using PowerShell
Below is what I have tried with no luck .
EXEC master.dbo.xp_cmdshell "SQLCMD -S SQLServer -d Db1 -A go select count(*) AS FileCount from TableName go"
'select' is not recognized as an internal or external command, operable program or batch file. NULL
Msg 103, Level 15, State 4, Line 1 The identifier that starts with '
SQLCMD -S SQLServer -d Db1 -A go select count(*) AS FileCount' is too long. Maximum length is 128.