![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hallo, I habe a little problem. I have two tables: Table Source: HERSTELLER --------------- Compaq Dell IBM Table Destination: FIRMCODE HERSTELLER ------------- ---------------- 1 Compaq 2 HP What I want to do is: Look which HERSTELLER are not present in the source and put it in the destination table. The FIRMCODE should have a continuing counter. So the result should look like: FIRMCODE HERSTELLER ------------- ---------------- 1 Compaq 2 HP 3 DELL 4 IBM Who can help? I have no idea how to realize the continiung counter and find out which entries are not in the destination. Best regards, Michael |
#2
| |||
| |||
|
|
alter TblDESTINATION field's FIRMCODE to Identity and do the ff: statement INSERT INTO TblDESTINATION SELECT HERSTELLER FROM TblSOURCE WHERE HERSTELLER NOT IN (SELECT HERSTELLER FROM TblDESTINATION) -- gani "Michael Papenhagen" <mpa (AT) b-w-computer (DOT) de> wrote in message news:3f522018$0$31843$9b622d9e (AT) news (DOT) freenet.de... Hallo, I habe a little problem. I have two tables: Table Source: HERSTELLER --------------- Compaq Dell IBM Table Destination: FIRMCODE HERSTELLER ------------- ---------------- 1 Compaq 2 HP What I want to do is: Look which HERSTELLER are not present in the source and put it in the destination table. The FIRMCODE should have a continuing counter. So the result should look like: FIRMCODE HERSTELLER ------------- ---------------- 1 Compaq 2 HP 3 DELL 4 IBM Who can help? I have no idea how to realize the continiung counter and find out which entries are not in the destination. Best regards, Michael |
#3
| |||
| |||
|
|
O.K. But how can we create the create the FIRMCODE? To get the highest number from firmcode we have to use select max(FIRMCODE) from tbldestination.... And then..??? Michael "gani" <a@a.com> schrieb im Newsbeitrag news:O9Kj91FcDHA.2436 (AT) TK2MSFTNGP12 (DOT) phx.gbl... alter TblDESTINATION field's FIRMCODE to Identity and do the ff: statement INSERT INTO TblDESTINATION SELECT HERSTELLER FROM TblSOURCE WHERE HERSTELLER NOT IN (SELECT HERSTELLER FROM TblDESTINATION) -- gani "Michael Papenhagen" <mpa (AT) b-w-computer (DOT) de> wrote in message news:3f522018$0$31843$9b622d9e (AT) news (DOT) freenet.de... Hallo, I habe a little problem. I have two tables: Table Source: HERSTELLER --------------- Compaq Dell IBM Table Destination: FIRMCODE HERSTELLER ------------- ---------------- 1 Compaq 2 HP What I want to do is: Look which HERSTELLER are not present in the source and put it in the destination table. The FIRMCODE should have a continuing counter. So the result should look like: FIRMCODE HERSTELLER ------------- ---------------- 1 Compaq 2 HP 3 DELL 4 IBM Who can help? I have no idea how to realize the continiung counter and find out which entries are not in the destination. Best regards, Michael |
![]() |
| Thread Tools | |
| Display Modes | |
| |