• I ran the script on SQL Sever2014 and got an error at lines
    SET @command = '
    .
    .
    .
    END';