Hi guys,
I am not a programmer OR a database guru, however, if I can do this following task, I will be a hero in my small company. Help me out? Please excuse my non programming language too, but I'm sure you guys will figure out what I need to do.
I have a number of tables in which there are a number of rows, each with a number of columns that are the field names.
For example, in a table called "Items", I have different columns that have the various item related fields. So the table looks like:
Item Code,Item_Description,Item_Size etc
Now the table has about 5000 rows and I need to delete certain rows depending on the Item Code.
I also have to delete ALL identical items from ALL the tables in the database, but in a particular order.
For example, if I try to delete item number 123456 from table "Items", SQL wont allow me to do that until I have deleted the corresponding row from the table "Quotations"
I therefore need to delete these items from all the tables in a particular sequence.
There are 16 Tables that I need to delete these items from and about 100 + items that need to be deleted.
I know how to Query each table for those particular item codes and then delete them manually (by selecting the row and right clicking delete), but as you can appreciate, this will take a LOOOooong time and I may need to repeat this process several times in the future.
Is there any way that I can enter all the item codes in one place somewhere (maybe Excel??!) and have some kind of automatic process that looks at my itemcodes and goes and deletes those rows in all the tables that I specify (in order ...like Delete those rows in Table "Quotations" first, then in table "Delivery_Status", then in table "ITems"... etc).
Am I dreaming? There mst be an easy solution that you SQL gurus must know...
Help me PUH lease??!?