Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

T-SQL Triggers to keep table current

$
0
0

Hi Everyone,

I am in the process of restructuring one of our databases. I am consolidating two tables into a single table, and will repeat this process for several pairs of tables. Our in-house software is written to access these pairs of tables separately, which means as I am working on it they are actively adding records to the pairs I am replacing.

ex: Table1 + Table2 = New_Table

So I need help understanding and writing a trigger in order to copy records added to the old pairs of tables into the new table, as well as keeping the records already in the new table as current as they are in the pairs tables.

I hope I explained well enough.

Thanks in advance!


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>