Microsoft SQL: Update multiple Rows using combined Values and compare them to Values from another Table : I have two Tables im my MS-SQL Database:
Table 1 looks like this:

----------

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

        <table>
          <tr>
            <th>Material</th>
            <th>Semifinished</th>
            <th>Number</th>
          </tr>
          <tr>
            <td>Steel</td>
            <td>Flat 1x2</td>
            <td></td>
          </tr>
          <tr>
            <td>Iron</td>
            <td>Round 100x200</td>
            <td></td>
          </tr>
        </table>

<!-- end snippet -->

----------
Table 2 looks like this:

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

        <table>
          <tr>
            <th>Material</th>
            <th>Semifinished</th>
            <th>Number</th>
          </tr>
          <tr>
            <td>Steel</td>
            <td>Flat 1x2</td>
            <td>8991</td>
          </tr>
          <tr>
            <td>Iron</td>
            <td>Round 100x200</td>
            <td>1234</td>
          </tr>
        </table>

<!-- end snippet -->


----------

Now i want to insert the values of the collumn "Number" from Table 2 into the Collumn "Number" from Table 1. The criteria for that should be the combination of columne "Material" and columne "Semifinished"

I tried this before:

update T1

set T1.NUMBER = T2.NUMBER
FROM	TABLE1 AS T1 INNER JOIN
		TABLE2 AS T2 ON T1.MATERIAL + T1.SEMIFINISHED = T2.MATERIAL + T2.SEMIFINISHED

WHERE T1.MATERIAL + T1.SEMIFINISHED = T2.MATERIAL + T2.SEMIFINISHED

I also tried this one:

ALTER TABLE TABLE1 ADD [NEWCOL] varchar(100)
ALTER TABLE TABLE2 ADD [NEWCOL] varchar(100)

update TABLE1 set NEWCOL = MATERIAL + SEMIFINISHED 

update TABLE2 set NEWCOL = MATERIAL + SEMIFINISHED


update T1

set T1.NUMBER = T2.NUMBER
FROM	TABLE1 AS T1 INNER JOIN
		TABLE2 AS T2 ON T1.NEWCOL = T2.NEWCOL

WHERE T1.NEWCOL = T2.NEWCOL
