Check if Constraint is enabled or disable

  • Comments posted to this topic are about the item Check if Constraint is enabled or disable

  • I think script is missing. Can you please check?

    Thanks

  • excuse me but this is my first post. I edited the script and now I wait for the publication of this issue.

    This is the script :

    select

    [Table] = o2.name,

    [Constraint] = o.name,

    [Enabled] = case when ((C.Status & 0x4000)) = 0 then 1 else 0 end

    from sys.sysconstraints C

    inner join sys.sysobjects o on o.id = c.constid -- and o.xtype='F'

    inner join sys.sysobjects o2 on o2.id = o.parent_obj

  • roberto armellin (11/3/2011)


    excuse me but this is my first post. I edited the script and now I wait for the publication of this issue.

    This is the script :

    select

    [Table] = o2.name,

    [Constraint] = o.name,

    [Enabled] = case when ((C.Status & 0x4000)) = 0 then 1 else 0 end

    from sys.sysconstraints C

    inner join sys.sysobjects o on o.id = c.constid -- and o.xtype='F'

    inner join sys.sysobjects o2 on o2.id = o.parent_obj

    No issues. Thanks for sharing.

    Thanks

  • Thanks for the script.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply