|
-
Sep 16th, 2019, 04:13 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Insert a child record for every existing parent ID
Hi,
I have in the database tblUsers:
UserID
LastName
FirstName
etc.
I now created another table tblUserSettings:
UserSettingID
UserID
Setting1
Setting2
etc.
So every user shall have some settings that I can use all over. e.g. I want to create 3 color themes, etc.
The problem that I now have is that this newly created tblUserSettings is empty and I have a lot of existing UserID's. I want to insert default (child) data for every existing UserID in tblUsers.
Meaning for every UserID in tblUsers insert default values to tblUserSettings.
This is a one time problem because in the future when a new user is created in tblUsers then I shall insert a record with default values for that user in tblUserSettings.
I guess I can do this manually, but it will a pain as it will take long time and maybe i can learn a quick way for future scenarios like this.
Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|