Sqlcmd: 'KReadOnly': Unknown Option I am using SQL Server 2014 SP2 with AG, running this command:

sqlcmd -S ABC-ISELL -E -d ABP_SFA_BMB -K ReadOnly


Where ABC-ISELL is the listener name, I am getting this error:

Sqlcmd: 'KReadOnly': Unknown Option. Enter '-?' for help.


sqlcmd -? shows there is no -K option, it`s just this:

[-k[1|2] remove[replace] control characters]


What could be wrong here?
One needs to use recent enough a version of sqlcmd. The parameter for application intent is -K. Note that sqlcmd's parameters are case sensitive, which is uncommon in Windows environment.

To check sqlcmd's version, run it with -? parameter. Like so,

C:\&gt;sqlcmd -?
Microsoft (R) SQL Server Command Line Tool
Version 14.0.1000.169 NT
Copyright (C) 2017 Microsoft Corporation. All rights reserved.

usage: Sqlcmd            [-U login id]          [-P password]
...
[-k[1|2] remove[replace] control characters]
...
-K application intent


For updated version, check Microsoft's product documentation, 
 there's a link to Download center.