COLUMNS_UPDATED can be used anywhere inside a Transact-SQL INSERT or UPDATE trigger.
The ORDINAL_POSITION column of the INFORMATION_SCHEMA. COLUMNS view is not compatible with the bit pattern of columns returned by COLUMNS_UPDATED.
This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.
I already know how to update multiple rows using my where clause, but I don't see how to update multiple columns.
COLUMNS_UPDATED returns multiple bytes if the table on which the trigger is created contains more than eight columns, with the least significant byte being the leftmost.
COLUMNS_UPDATED returns TRUE for all columns in INSERT actions because the columns have either explicit values or implicit (NULL) values inserted.
To test whether all columns 2, 3, and 4 are updated, use = 14 instead of 0 /*Use IF (COLUMNS_UPDATED() & 14) = 14 to see whether all columns 2, 3, and 4 are updated.*/ BEGIN -- Audit OLD record.
INSERT INTO dbo.audit Employee Data (audit_log_type, audit_emp_id, audit_emp_bank Account Number, audit_emp_salary, audit_emp_SSN) SELECT ' OLD', del.emp_id, del.emp_bank Account Number, del.emp_salary, del.emp_SSN FROM deleted del; -- Audit NEW record.