-1

I have two temporary tables

#tempA
 colum1      |   colum2   |   colum3
-------------+------------+----------+
        0001 | NULL       |05/10/2022|
        0002 | NULL       |06/10/2022| 
        0003 | NULL       |07/10/2022|

#tempB

#tempB
 dato1       |   dato2    |  
-------------+------------+
             |            |
             |            | 
             |            |

I want to insert the values on colum1 and colum3 from #tempA into to #tempB(dato1,dato2)

2 Answers2

0

As long as you used the same data types:

INSERT INTO tempB
SELECT colum1, colum3 FROM tempA;
Wolric
  • 701
  • 1
  • 2
  • 18
0

Use the 'INSERT INTO SELECT' statement:

INSERT INTO #tempB(dato1, dato2) 
SELECT colum1, colum3 
FROM
#tempA