title: Must declare the scalar variable & Incorrect syntax near
body: <p>how to fix this problem
  it was work but i add some new lines and change some then this error appear 
  it was @Old_CH_SWORD_ID and i changed it to @Old_CH_HA_ID like codes down and same with all codes i change all 
  and this the declare</p>
  
  <pre><code> Declare @CreaterName Varchar(60) = 'iLegend' , -- Creater Name
   @WeaponSlot Int = 13 , -- char inventory weapon slot
   @ReqOptLevel Int = 7    , -- Change old item requiared plus for upgrade.
   @NewOptLevel Int = 0    , -- Change new item plus after upgrade
   @Old_CH_HA_ID Int  = 4265    , @New_CH_HA_ID Int  = 39022  ,    --@New 
   Chinese Sword
   @Old_CH_SA_ID Int = 4337    , @New_CH_SA_ID Int = 39025  ,    --@Chinese 
   Glaive
   @Old_CH_BA_ID Int  = 4373    , @New_CH_BA_ID Int  = 39028  ,    --@Chinese 
   Blade
   @Old_CH_LA_ID Int    = 4409    , @New_CH_LA_ID Int    = 39031  ,    --
   @Chinese Bow
   @Old_CH_AA_ID Int = 4445    , @New_CH_AA_ID Int    = 39034   ,    --
   @Chinese Shield
   @Old_EU_FA_ID Int = 4481    , @New_EU_FA_ID Int = 39037  ,    --@European 
   Dagger
   Update [SRO_VT_SHARD].[dbo].[_Items] Set RefItemID = @New_CH_HA_ID  , 
   OptLevel = @NewOptLevel , CreaterName = @CreaterName Where ID64 = (Select           
   ItemID From [SRO_VT_SHARD].[dbo].[_Inventory] Where CharID = @CharID and 
   Slot =      
   @WeaponSlot and ItemID&gt; 0) and RefItemID = @Old_CH_HA_ID  and (OptLevel &gt;= 
   @ReqOptLevel)    --@Sword
   Update [SRO_VT_SHARD].[dbo].[_Items] Set RefItemID = @New_CH_BA_ID  , 
   OptLevel = @NewOptLevel , CreaterName = @CreaterName Where ID64 = (Select 
   ItemID From [SRO_VT_SHARD].[dbo].[_Inventory] Where CharID = @CharID and 
   Slot = @WeaponSlot and ItemID&gt; 0) and RefItemID = @Old_CH_BA_ID  and 
   (OptLevel &gt;= @ReqOptLevel)    --@Blade
   Update [SRO_VT_SHARD].[dbo].[_Items] Set RefItemID = @New_CH_SA_ID , 
   OptLevel = @NewOptLevel , CreaterName = @CreaterName Where ID64 = (Select 
   ItemID From [SRO_VT_SHARD].[dbo].[_Inventory] Where CharID = @CharID and 
   Slot = @WeaponSlot and ItemID&gt; 0) and RefItemID = @Old_CH_SA_ID and 
   (OptLevel &gt;= @ReqOptLevel)    --@T-Blade
   Update [SRO_VT_SHARD].[dbo].[_Items] Set RefItemID = @New_CH_LA_ID    , 
   OptLevel = @NewOptLevel , CreaterName = @CreaterName Where ID64 = (Select 
   ItemID From [SRO_VT_SHARD].[dbo].[_Inventory] Where CharID = @CharID and 
   Slot = 
   @WeaponSlot and ItemID&gt; 0) and RefItemID = @Old_CH_LA_ID    and (OptLevel 
   &gt;= 
   @ReqOptLevel)    --@Bow
   Update [SRO_VT_SHARD].[dbo].[_Items] Set RefItemID = @New_CH_AA_ID , 
   OptLevel = @NewOptLevel , CreaterName = @CreaterName Where ID64 = (Select 
   ItemID 
   From [SRO_VT_SHARD].[dbo].[_Inventory] Where CharID = @CharID and Slot = 
   @WeaponSlot and ItemID&gt; 0) and RefItemID = @Old_CH_AA_ID and (OptLevel &gt;= 
   @ReqOptLevel)    --@Shield
   Update [SRO_VT_SHARD].[dbo].[_Items] Set RefItemID = @New_EU_FA_ID , 
   OptLevel = @NewOptLevel , CreaterName = @CreaterName Where ID64 = (Select 
   ItemID 
   From [SRO_VT_SHARD].[dbo].[_Inventory] Where CharID = @CharID and Slot = 
   @WeaponSlot and ItemID&gt; 0) and RefItemID = @Old_EU_FA_ID and (OptLevel &gt;= 
   @ReqOptLevel)    --@Dagger
  </code></pre>
  
  <p>this 
      Msg 102, Level 15, State 1, Procedure _UpgradeSystemSETSUN, Line 24
      Incorrect syntax near '@Old_CH_HA_ID'.
   start from here</p>
  
  <p>this sortcut from code</p>
  
  <hr>
  
  <pre><code>Msg 102, Level 15, State 1, Procedure _UpgradeSystemSETSUN, Line 24
  Incorrect syntax near '@Old_CH_HA_ID'.
  Msg 137, Level 15, State 2, Procedure _UpgradeSystemSETSUN, Line 126
  Must declare the scalar variable "@New_CH_HA_ID".
  Msg 137, Level 15, State 2, Procedure _UpgradeSystemSETSUN, Line 126
  Must declare the scalar variable "@WeaponSlot".
  Msg 137, Level 15, State 2, Procedure _UpgradeSystemSETSUN, Line 127
  Must declare the scalar variable "@New_CH_BA_ID".
  Msg 137, Level 15, State 2, Procedure _UpgradeSystemSETSUN, Line 127
  Must declare the scalar variable "@WeaponSlot".
  Msg 137, Level 15, State 2, Procedure _UpgradeSystemSETSUN, Line 128
  ...... more
  </code></pre>