Moving data from one table to another
Hi,
I havent done CF in a log time and i have a question,
My client has an admin site for his inventory in a db (MS SQL) one of the table (inventory) has 180 fields (which are options for the items) with around 100 records that are being added/deleted per week, he now whants to keep the deleted data has reference to what happened to them.
What i want to do is move all the data berofe deleting the record of Inventory to inventory_deleted without having to specify all the 180 fields name to be moved 🙂 yep lazy
I already copied the table without the data all i need is some sort of query to move invetory_deleted before I delete it from inventory
I'v tryed adding a active/deleted field to the table, but this is a huge site and it causes to many problems everywhere else when showing data, stats ...etc
here is the delete code 🙂
<cfquery datasource="#clientds#">
DELETE FROM inventory
WHERE inv_number=#form.inv_num#
</cfquery>
and this is what i tested so far
<cfquery datasource="#clientds">
insert into inventory_deleted (*)
select *
from inventory
WHERE inv_number=#form.inv_num#
</cfquery>
Help would be really apreciated
