Thanks for your answers. I think I figured out a solution:
-----------
CREATE TABLE LU_CLIENT_BU(
CLIENT_BU_ID INT IDENTITY(0,1) PRIMARY KEY,
CLIENT_BU_DESC_1 VARCHAR(80),
CLIENT_BU_DESC_2 VARCHAR(80),
CLIENT_BU_DESC_3 VARCHAR(80)
);
INSERT INTO LU_CLIENT_BU
SELECT DISTINCT TARGETBU, CBU, CBU1, CBU2
FROM CLIENT;
-----------
The IDENTITY(0,1) allows to define an automatic increment from 0 to x (+1 each time a row is inserted in the table). So I basically define the new PK CLIEN_BU_ID as INT and then I can populate my new table fromt the old one. A new unique ID is generated for each row inserted.
I don't use the CLIENT table afterward.
Cheers
|