title: UPDATE within a table from table name saved in the column
body: <p>I have a little problem, but I'm sure it s not really complicated.</p>
  
  <p>It's just hard to find the key word to describe the problem and find a solution</p>
  
  <p>I want to update a column in a table using parameters from this table for a query on an other table.</p>
  
  <p>Example : I have Header + 2 lines</p>
  
  <pre><code>IDSOURCE, IDCIBLE, IDENTIFIANT, TABLE_CIBLE, NOM_ATTRIBUT, NOM_CHAMP_IDENTTIFIANT, NOM_CIBLE 
  --------------------------------------------------------------------------------------------    
  DMT_1000, DMT_1000, 1000, [dictionnaire].[dbo].[TABLE_CHAMPS_DATAMART], NOM_CHAMP_DMT, IDENTIFIANT_CHAMP_DATAMART, NULL 
  DMT_1001, DMT_1001, 1001, [dictionnaire].[dbo].[TABLE_CHAMPS_DATAMART], NOM_CHAMP_DMT, IDENTIFIANT_CHAMP_DATAMART, NULL
  </code></pre>
  
  <p>And I want to update the last column of each line with something like : </p>
  
  <pre><code>UPDATE
      Table
  SET
      Table.NOM_CIBLE = SELECT table.NOM_ATTRIBUT FROM table.TABLE_CIBLE WHERE table.NOM_CHAMP_IDENTTIFIANT = table.IDCIBLE
  FROM
      Table
  </code></pre>
  
  <p>Don't know if it s clear.</p>
  
  <p>Thanks for your help.</p>