May 30, 2008 at 6:14 am
hi
I am trying to write a trigger (after update) in which i am using COLUMNS_UPDATED( ) function.
For this i was trying to get ColumnID value for the columns of the table.
I am trying following query but getting Null as ColumnID value
Is it a permission related issue or any configuration needs to set?
SELECT TABLE_NAME, COLUMN_NAME,
COLUMNPROPERTY(OBJECT_ID(TABLE_SCHEMA + '.' + TABLE_NAME),
COLUMN_NAME, 'ColumnID') AS COLUMN_ID
FROM sample1.INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'emp';
Thanks
May 30, 2008 at 7:15 am
Are you working with two different databases? I could see that the select is querying in sample1 database.
--Ramesh
May 30, 2008 at 7:50 am
No i am working on single database i.e. sample1
The table emp is in sample1 database
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply