This issue occurs if the SA password has special characters as & or %.
For example, if the password of SA is m08ug&SB
. Then it will failed with below error.
sqlcmd -U sa -P ****** -S XXXXX-XXXXX,XXXX-m 11 -e -i chk_trans_level.sql 2>&1
'SB:' is not recognized as an internal or external command,
operable program or batch file.