sql - Trigger UPDATE() and COLUMNS_UPDATED() functions -


I have after triggering an update on the table.

I have to get the name change of colon and this old and new value.

To resolve UPDATE (column_name) with each column - Bad solution but I can not find all table column names through query

  SELECT COLUMN_NAME from INFORMATION_SCHEMA.ColumnsWHERE TABLE_NAME = 'smth'   

and dynamically UPDATE (@column_name) value in the cursor.

At the same time when I try to use the COLUMNS_UPDATED () function, when I update only one column in the table, updated columns with I (ORDINAL_POSITION = 31) ) 32 (updated column with ORDINAL_POSITION = 30) 8 (updated column with ORDINAL_POSITION = 29 9) with 4 (updated column) ORDINAL_POSITION = 28) 2 (updated column with ORDINAL_POSITION = 27) 1 (Updated column with ORDINAL_POSITION = 26) 32768 (updated column with ORDINAL_POSITION = 25)

I think That's it weird and ask your help.

Whether it is weird or not, this is the least:

Warning

In SQL Server 2008, the ORDINAL_POSITION colu INFORMATION_SCHEMA.COLUMNS view is not compatible with the bit pattern of the returned column by the MN COLUMNS_UPDATED. To get the corresponding bit pattern with COLUMNS_UPDATED, when you refer to INFORMATION_SCHEMA.COLUMNS, reference the column id property of the COLUMNPROPERTY system function as shown in the following example.

  SELECT TABLE_NAME, COLUMN_NAME, COLUMNPROPERTY (OBJECT_ID (TABLE_SCHEMA + '.' + TABLE_NAME), COLUMN_NAME, 'ColumnID') from AdMandWorks-2008 R2 to COLUMN_ID. INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'Contact';     

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -