I'm new to SQL Server and triggers. I want to create a trigger that fires when new rows are inserted or existing rows are updated. The trigger will update a set of calculated columns.
Can someone give me a basic trigger that checks if fldType = 'INVALID'
, if it is, it sets another column errInvalid
to 1
.
Bare in mind that there will be 5000 rows inserted (in a single hit) per day so performance is an issue. I have looked elsewhere, but just getting confused.
OK, my question has evolved. I've driven down the Persisted Colums route. I've created a succesfull basic persisted field, but having trouble with a nested logic pf.
Can I (and how) do the following:
case when [MissCustName] IS true then when [CustomerAccountName] IS NULL then (1) else (0) end else (0) end