Is it possible to use a trigger to update multiple rows? For example, I have an app that will use a Table Value Param & a SQL Stored Proc to dump anywhere between 15 and 20 rows into a table. Once that data is dumped, I then need a way (I was thinking a trigger) to update the remaining "missing" fields. I thought this approach may work (it is the valid syntax for my update)
Create TRIGGER [dbo].[UpdateFields] ON [dbo].[TFData] AFTER INSERT AS BEGIN SET NOCOUNT ON; UPDATE a Set a.DateOfInjury = b.InjurDate ,a.GameNum = c.GameNum FROM [dbo].[InjuryReport] a INNER JOIN [dbo].[GameStats] b ON a.playnum = b.playnum INNER JOIN [dbo].[GameSched] c On b.gamenum = c.gamenum
How would I need to code this trigger to update multiple rows? I assume I would somehow need to join on the virtual table but I am not certain.