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

SQL Trigger to mirror a value in two tables

$
0
0

I am hoping to get some assistance in my logic - i have been on other forums and basically shot down as I am a beginner to SQL Triggers..

I just have a question as to what is the best way to accomplish the below:

If i insert a new record into opportunity table, i can select a value for field stage. Stage has 5 values (Not started, Initial communication, Proposal, Quote submitted and signed off)

Once i chose an option and then save the entry - this inserts a new opportunity to the opportunity table.

I then have a field called OppStage which is part of another table. I would like the stage from the opportunities table to mirror into the OppStage table. Both Stages have the same value in both tables.

is there a simple trigger that i can use to achieve the above?


Viewing all articles
Browse latest Browse all 4871

Trending Articles



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