I'm in Microsoft Sql Server I have three table.
The first table have just a field with ID_CONTACT
.
CREATE TABLE USERS_CONTACT(
[ID_CONTACT] [int] NOT NULL PRIMARY KEY
)
The second table have a field with UNIQUE_CODE
CREATE TABLE TMP_UNIC_CODE_RECETTE(
[UNIC_CODE] varchar(10)
)
I have a third table with two field:
> ID_CONTACT, UNIC_CODE
CREATE TABLE UNIC_CODE_RECETTE(
[ID_CONTACT] [int] NOT NULL PRIMARY KEY,
[UNIC_CODE] varchar(10)
)
This two table haven't join. I need to push on the third table the ID_CONTACT and the UNIC_CODE randomly
I have try this:
INSERT INTO UNIC_CODE_RECETTE
(ID_CONTACT, UNIC_CODE)
SELECT ID, (SELECT REAC FROM TMP_UNIC_CODE_RECETTE )
FROM USERS_CONTACT
But it doesn't work.
Can you help me for the query ?
Thanks