Hello @SnehaSheshadri-7717,
Thanks for the question and also for using this forum.
On a very quick glance I can see the issue with the line
DECLARE @modelvarbinary(max) = (SELECT Model FROM [wwi_mcw].[ASAMCWMLModel] WHERE Id = (SELECT Top(1) max(ID)
FROM [wwi_mcw].[ASAMCWMLModel]));
It should be ( please beware that there is a space between @model & varbinary )
DECLARE @model varbinary(max) = (SELECT Model FROM [wwi_mcw].[ASAMCWMLModel] WHERE Id = (SELECT Top(1) max(ID)
FROM [wwi_mcw].[ASAMCWMLModel]));
Please do let em know how it goes .
Thanks & stay safe
Himanshu
Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members