how to update without reference key

  • 3 tables : 1. POS (Material, Customer, day, POS) 2. Material (Material, MATL_TYPE, MATL_GROUP, MKTG_LABEL_DESC, MKTG_CATG) 3. Customer (customer, DMA, DIVISion, state, country, corp_cust, DMA_DESC)

    Using join on customer and material and brining (POS, MATL_TYPE, MKTG_CATG,DMA, DIVISION) in Final Table

    If any field changes in customer or material table, to bring that change I need to drop and reload data into Final Table.

    Is it Possible to update those fields in Final table without running the whole process?

  • 2sbhagat (4/9/2015)


    3 tables : 1. POS (Material, Customer, day, POS) 2. Material (Material, MATL_TYPE, MATL_GROUP, MKTG_LABEL_DESC, MKTG_CATG) 3. Customer (customer, DMA, DIVISion, state, country, corp_cust, DMA_DESC)

    ?Using join on customer and material and brining (POS, MATL_TYPE, MKTG_CATG,DMA, DIVISION) in Final Table

    ?If any field changes in customer or material table, to bring that change I need to drop and reload data into Final Table.

    ?Is it Possible to update those fields in Final table without running the whole process?

    This sound strangely like an interview question or homework. If it isn't either of those you need to provide some information. What process? What are you trying to do?

    _______________________________________________________________

    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/

  • First there is no way to join your customer table to your materials table. It does sound like homework and a trick question at that.

    If real, then you need to read up on triggers and the Inserted table.

    Sigerson

    "No pressure, no diamonds." - Thomas Carlyle

  • Query is like select a.pos, b.MATL_TYPE, b.MKTG_CATG,c.DMA, c.DIVISION

    From pos a

    Inner join material b on a.Material=b.Material

    JOIN Customer c ON a.Customer=c.Customer

    Now changes happening in customer and material. How should I bring changes without running the whole query. If it is possible. Thank you

  • A trigger can be set to fire when a table is updated, inserted to, or deleted from. Have the trigger fire some t-sql code to do the processing you need.

    But as I said, you'll have to read up on table triggers and the Inserted table. Go to the Help menu, and click 'Search' Or you could do a search on this site, see if some nice person has written an article about it.

    Sigerson

    "No pressure, no diamonds." - Thomas Carlyle

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply