locked
How do I make relationship between already inserted data in two of tables? RRS feed

  • Question

  • Hi,

    I've relational tables same like following picture;

    I just inserted data each tables before make 1:m relationship.

    So now each tables already existed data BUT ACTUALLY NOT RELATED DATA EACH OTHERS sames like following picture. :(

    I need to solution that each tables data make relationship as a query or script.

    Fortunately, NumericCode field was related data each tables.

    How should I make relationship each data in a query command?

    Tuesday, August 28, 2012 10:16 AM

Answers

  • Hi,

    You can us below script to update CountryID

    update co4
    set co4.countryID = c.countryID
    from CurrencyOf4217 co4
    inner join CountryOf3166 c on c.numericCode = c04.numericCode


    - Chintak (My Blog)

    • Marked as answer by David Hur Tuesday, August 28, 2012 2:14 PM
    Tuesday, August 28, 2012 10:22 AM

All replies

  • Hi,

    You can us below script to update CountryID

    update co4
    set co4.countryID = c.countryID
    from CurrencyOf4217 co4
    inner join CountryOf3166 c on c.numericCode = c04.numericCode


    - Chintak (My Blog)

    • Marked as answer by David Hur Tuesday, August 28, 2012 2:14 PM
    Tuesday, August 28, 2012 10:22 AM
  • Thank you very much! Chintak Chhapia,

    You make me happy!

    Tuesday, August 28, 2012 2:51 PM