Skip to main content
deleted 5 characters in body
Source Link
H. Pauwelyn
  • 930
  • 6
  • 18
  • 35

I have two tables and I want updateupdate the column GebruikerID from table Topic with the ID of the table Gebruiker with random values.

You must also know the follow things:

  • Topic.GebruikerID references to Gebruiker.ID.
  • Not every ID is used in both tables.
  • The random number that must be generated exist in the table Gebruiker (column ID) and must be updated into the table Topic (column GebruikerID).
  • I use SQL server in an express edition.

Here are some images.

  • The relation between the tables

  • The ID's of the Gebruiker-table

I have two tables and I want update the column GebruikerID from table Topic with the ID of the table Gebruiker with random values.

You must also know the follow things:

  • Topic.GebruikerID references to Gebruiker.ID.
  • Not every ID is used in both tables.
  • The random number that must be generated exist in the table Gebruiker (column ID) and must be updated into the table Topic (column GebruikerID).
  • I use SQL server in an express edition.

Here are some images.

  • The relation between the tables

  • The ID's of the Gebruiker-table

I have two tables and I want update the column GebruikerID from table Topic with the ID of the table Gebruiker with random values.

You must also know the follow things:

  • Topic.GebruikerID references to Gebruiker.ID.
  • Not every ID is used in both tables.
  • The random number that must be generated exist in the table Gebruiker (column ID) and must be updated into the table Topic (column GebruikerID).
  • I use SQL server in an express edition.

Here are some images.

  • The relation between the tables

  • The ID's of the Gebruiker-table

Source Link
H. Pauwelyn
  • 930
  • 6
  • 18
  • 35

fill table A with random ID's from another table B

I have two tables and I want update the column GebruikerID from table Topic with the ID of the table Gebruiker with random values.

You must also know the follow things:

  • Topic.GebruikerID references to Gebruiker.ID.
  • Not every ID is used in both tables.
  • The random number that must be generated exist in the table Gebruiker (column ID) and must be updated into the table Topic (column GebruikerID).
  • I use SQL server in an express edition.

Here are some images.

  • The relation between the tables

  • The ID's of the Gebruiker-table