I'm trying to set up a batch script that basically runs a SQL statement against a database, and if the script returns results it will follow some logic.
Is there a way to use a LIKE operator with % in SQLCMD Just like below. Since .bat files are treating % as a command, currently I am not getting any rows against the query.
sqlcmd -S servername -d dbname -E -Q "SELECT * from sometable WITH (NOLOCK) where col_1 like '%SE%'"