Simple Trigger SQL Server

Simple Trigger SQL Server



I'm new in SQL Server, and I have to make a trigger to help me to insert data in my table.



I have 2 simples tables, Test and Participant. (id + varchar each one).
Test are already inserted.



In a 3rd table, Inscription I would like to make an entry with each test each time I add a student in my student table



The 3rd table would be like : id | FK_idTest | FK_idStudent



Base­



I'm not familiar with sql language, i'm currently searching how to do this action, and I ask here too.
I'll come back if I find something by myself. I'll also take a look in the trigger section.






No one here will write the code for you. You write the code, and if you run into problems, we will assist!

– jarlh
Sep 11 '18 at 10:24






Students will be linked with all the tests. I was hoping i could use a for each to get all the tests then insert them in the 3rd table.

– Alban
Sep 11 '18 at 10:30






If the table will always have every student vs every test and no other fields then it doesn't seem like it serves a useful purpose... what do you intend to use this table for?

– Milney
Sep 11 '18 at 11:00







Triggers are a topic best addressed after you have mastered basic tsql.

– SMor
Sep 11 '18 at 12:15




0



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)