Performance Problem on Transaction. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Performance Problem on Transaction.

Hi guys i have a question about the performance on my stored procedure.
I have 2 table with a Header and Detail relationship connected by a TRANSACTIONID In a scenario where i created a new transaction,
i save the record in header table,
get the generated TRANSACTIONID,
and save it to the Detail Table (that just works fine). But when i tried to update a certain transaction,
first i delete all my detail records with corresponding transactionid,
and insert the new records in the detail table. My coworker said this is fine, but he says it will create a problem when the records become more and more abundant. Can you suggest a better way? thanks.
Why would you do that? Can you post an example of the data and maybe it will make more sense. It sounds like you should just do an update statement. The delete will be hard on your indexes. MeanOldDBA
[email protected] When life gives you a lemon, fire the DBA.