Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2010-04-01 : 16:25:47
|
| All,I have the following trigger which is built to update date_time_mod whenever an update is fired on the table, however the trigger is updating the date_time_mod of the first row only when a mass update is fired. Is there anyway to get around to update the date_time_mod for all the rows effected by the mass update statement.ALTER TRIGGER [dbo].[TRG_table_DT_MOD] ON [dbo].[table] AFTER INSERT, UPDATE NOT FOR REPLICATION AS BEGIN SET NOCOUNT ON IF TRIGGER_NESTLEVEL() > 1 RETURN declare @table_id bigint select @table_id=table_id from INSERTED UPDATE table SET DATE_TIME_MOD = GETDATE() WHERE table_id = @table_id end GObelow is the mass update statement which effects 200 rows but the date_time_mod is updated only for the first row.update table set user_id = user_idAny suggestions and inputs would help.Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
scelamko
Constraint Violating Yak Guru
309 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|