I need to create a .csv file out of table A upon the insertion of a record into table B. It seems to me that this should be easy to accomplish, but the only answer I can get from anyone is to do a scheduled DTS package, which means we are dumping this table every couple of minutes all throughout the day.
How do I build a trigger that would accomplish this?
Software/Hardware used:
ASKED:
March 24, 2005 2:32 PM
UPDATED:
March 30, 2005 7:37 AM
Zannemarie, you state that you require a .csv file to be created from table A after insertion of a record into table B. Therefore every time you insert a record into B a .csv will be created from A when applying a trigger.
Reading further it appears that you do not wish to have table A dumped (.csv created) every time a record is inserted in B.
Could you explain your process in a little more detail i.e is the .csv to be created once a day or only on insertion of a special type of record in file B?
Let us know
Fanbot
Actually, I really -do- want to create the .csv file out of table A every time we insert a record into table B. That’s how we figured it would be easiest for the client to trigger the event. So the only time there would be an insert, would be when the client clicked the link, inserting the record with their loginname and date/time. Does that make it easier?
Zannemarie, As the the first reply stated, use a trigger AFTER INSERT of a record into file B to call your procedure to create the .csv file from file A.
However, if you have multiple inserts from various clients (file B)and you only wish to create a .csv under certain conditions, evaluate the the trigger data from file B prior to building the .csv.
Hope this helps.