• Many thanks for your reply.

    I had considered that option but I was not allowed to use it (there were concerns that SQLCMD might not exist on the client PC).

    In the end, I preprocessed the script file by commenting out the SQLCMD syntax and replacing the variables with the assigned values.

    That was adequate and worked.