Results 1 to 2 of 2
Thread: SQL (2000)
2004-06-16, 08:12 #1
- Join Date
- May 2003
- Manchester, Gtr Manchester, England
- Thanked 0 Times in 0 Posts
Have a one to many relation, further analysis and user feedback means I need to re model, a field in the many relation should be on the one side. How can I take this many field and append to the one side. I am happy to just append the first record in the many obviously losing other entries where there is more than one.
2004-06-16, 08:24 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 Posts
Re: SQL (2000)
If the field really belongs on the 'one' side, its value should be the same for all records on the 'many' side associated with a single record on the 'one' side. So you don't really care which record on the 'many' side is used to populate the field on the 'one' side. You can do it as follows:
- Open the 'one' table in design view.
- Add the new field and set its properties.
- Close and save the table.
- Create a new query, based on the 'one' and the 'many' table, joined on the link field.
- Add the new field from the 'one' table to the query grid.
- Select Query | Update Query.
- In the 'Update To' row, enter <code>[Name_of_ManyTable].[Name_of_ManyField]</code> with the appropriate names substituted.
- Execute the query (Query | Run or click the Run button.)