Altering sql tables based on condition
Posted
by
Parker
on Stack Overflow
See other posts from Stack Overflow
or by Parker
Published on 2010-12-22T23:59:34Z
Indexed on
2010/12/23
0:54 UTC
Read the original article
Hit count: 183
Is there any possible way to add a row of data to only some of the tables in a database? I am not sure what parameter I could use amongst the tables to compare them to each other. Any Ideas? For Example: My database has tables that are (let's say) group A tables, and tables that are group B. I want to add a row to only the group B tables while leaving the group A tables untouched.
Sorry I should have been a bit more specific. The tables that need to have a row added will change. My application monitors inventory in different store locations(each table in my database represents a store). When I need to add an item to inventory(the items are rows in the tables) I don't want to have to manually add the row to all the store tables.
My problem is: Not all the tables in the database represent stores. For instance one table stores the user login data. Obviously I do not want to add the new row to this table. How do I update only the tables that represent stores?
© Stack Overflow or respective owner