Problem with Bulk insert and insert trigger
-
Hi all, I have a table Adp_Item_Conversion with following fields ConversionID identity, BranchID, Itemcode, BatchNo, LotNo, Date, CTSCode And i need to insert data in this table using a select query on other table as well as some predefined variables because the number of rows to be inserted is not fixed. insert into Adp_Item_Conversion ( BranchID, Itemcode, BatchNo, LotNo, Date, CTSCode ) select @branchID,Adp_master_detail.child_itemcode,@Br_No,@lt_No,@tr_date,@tr_code from Adp_master_detail where Adp_master_detail.Parent_Item=@ParentItemID The problem is I have written an insert trigger on the table. The trigger only writes the last record to the log table. Although i have access to the trigger , i cannot change it now. So i need to rewrite the insert query so as to accommodate the insert as shown above and also the insert should be 1 row at a time. Can i use cursors or is there a other way round????
When you fail to plan, you are planning to fail.