Home Forums SQL Server 2008 SQL Server 2008 - General How to update data in a table having primary key - foreign key link with another table RE: How to update data in a table having primary key - foreign key link with another table

  • pwalter83 (7/29/2013)


    Hello,

    Could someone please tell how can data be updated (refreshed) in one table if the data is refreshed on another table and both tables are linked through a primary key - foreign key ?

    I just need to know what logic I need to apply to update the values in a table if the same value has been refreshed in another table.

    Thanks.

    Without any more details about this I doubt anybody has much to offer. I think that what you are saying is that you have tablea and tableb. There is some column in tableb that is a foreign key to a column in tablea? Can you cascade updates and deletes on the foreign key? Or is your question because the update has already happened and now you want to fix the data in tableb?

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/