ColumnID is getting as Null

  • 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

  • Are you working with two different databases? I could see that the select is querying in sample1 database.

    --Ramesh


  • 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