Hi- I have a Dought.
I have 2 tables, they are:
Table 1 with 2 fields and Table 2 that has 3 fields.
Table 1 has this 2 fields:
Name and address.
Table 2 has this 3 fields:
Number , Name and address.
This table 1 has 20000 records (for example) and I need to put this records (insert ) into table 2.
Two of the fields in this two tables are exactly of the same type and name.
But table 2 has one more field (that is not an identity, and it will not became one identity field) , that is numeric (int).
Table 2 has already same records and I need to insert now , all the data from table 1 to table 2.
Suppose my table 2 data is this:
1 Paul Street1
2 Marc Street2
How can I insert (code sample) the data of table1 into table 2 and the field of type number of table 2 is incremented in 1 every time a new record is placed on table2 ?
I only know how to do this by using cursors, but that’s not good.
Can someone help me please?
In this case , the first record to be insert into table2 would be inserted with the number 3.