Hi, am a learner and have no experience in programming nor sql. I have the following issue that i have failed to figure out how to implement.
I have the following columns (extract) in my admission table (Using entity framework core)
- StudentNo(nvarchar(30))
- ProgrammID(FK, nvarchar(10))
- IntakeID(Fk, nvarchar(10))
StudentNo Column should be generated from the programmID and IntakeID column in the following formatt
"ProgrammID/IntakeId/Index/current year" for instance
studentNo : ............. ProgrammID: .. IntakeID
B01/M/001/2019:...... B01 :................ M
B01/M/002/2019:...... B01 :................ M
B01/J/001/2019 :...... B01 :................ J
B01/J/002/2019 :...... B01 :................ J
C01/M/001/2019 :..... C01 :.............. M
C01/M/002/2019 :..... C01:............... M
C01/J/001/2019 :...... C01 :............... J
C01/J/002/2019 :...... C01 :............... J
How can i write a trigger to achieve the above, the studentNo column changes when the ProgrammID and IntakeID changes.
Please help, Thanks in advance.