Check if Constraint is enabled or disable

  • roberto armellin

    SSC Enthusiast

    Points: 146

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

  • Hardy21

    SSCrazy Eights

    Points: 9708

    I think script is missing. Can you please check?

    Thanks

  • roberto armellin

    SSC Enthusiast

    Points: 146

    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

  • Hardy21

    SSCrazy Eights

    Points: 9708

    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

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    Thanks for the script.

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

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