title: update record attributes in multiple tables
body: <p>I need to update select occurrences in different tables of the [ISD_ID] attribute, how might I accomplish this?</p>
  
  <p>I can grab the set of tables that possess the records I'm looking for with this statement:</p>
  
  <pre><code>SELECT c1.TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS c1
  INNER JOIN information_schema.COLUMNS c2
  ON c1.TABLE_NAME = c2.TABLE_NAME
   WHERE c1.COLUMN_NAME LIKE '%isd%id%' and c2.column_name LIKE '%schooldistrict%id%'
  </code></pre>
  
  <p>So now I have a set of table names that I'd like to iterate through, updating records as necessary.</p>
  
  <p>Per a suggestion in another post, I've read up on Dynamic SQL.  So I could do something like <code>EXECUTE IMMEDIATE: ('update' + @tablename + ' set ISD_ID=37 where SchoolDistrictID=46')</code> .</p>
  
  <p>My question, then, is: how can I iterate through my table names and substitute them into the above statement as the <code>@tablename</code> variable, so that I can update the values in each table?</p>
  
  <p>I also have the ability to use .NET and SSIS if need be.</p>
  
  <p>Thanks in advance; I'm not so proficient with SQL and appreciate the opportunity to learn.</p>