Search code examples
c#.nettriggersclrsqlclient

Access updated/inserted values using CLR tiggers


I have a requirement of getting updated/inserted values in SQL server 2008 using CLR method. I read on net that “trigger is meant for validation also”, But I am not getting how to get the incoming values ( before or after update/insert) to the SQL server using .net assembly System.Data.SqlClient , SqlDataReader method. Is it possible to get the updated/inserted values using dll ?

Please help me.


Solution

  • If (triggContext.IsUpdatedColumn(colno).ToString() = True ) means then it indicates that the column is updated/inserted. Then I can get the values using sqlComm.ExecuteReader(colno).