title: How to add an update statement value to a variable?
body: <p>I want to save data in a variable and use it later in a procedure.</p>
  
  <pre><code>UPDATE  acc_Account
                  SET     acc_Account.CompanyID = ( SELECT TOP 1
                                                            utl_Company.CompanyID
                                                    FROM    utl_Company
                                                    ORDER BY CompanyID DESC
                                                  )
                  WHERE   acc_Account.AccountNumber = @AccountNumber 
  </code></pre>
  
  <p>how can I save the CompanyID in a variable to use it in an insert statement later on?</p>