I hope this is a simple enough question for any SQL people out there...
We have a table which hold system configuration data, and this is tied to a history table via
For triggers in general, you need to use a cursor to handle inserts or updates of multiple rows. For example:
DECLARE @Attribute;
DECLARE @ParameterValue;
DECLARE mycursor CURSOR FOR SELECT Attribute, ParameterValue FROM inserted;
OPEN mycursor;
FETCH NEXT FROM mycursor into @Attribute, @ParameterValue;
WHILE @@FETCH_STATUS = 0
BEGIN
If @Attribute LIKE 'NoHist_%'
Begin
Return
End
etc.
FETCH NEXT FROM mycursor into @Attribute, @ParameterValue;
END
Triggers, at least in SQL Server, are a big pain and I avoid using them at all.