getting the check constrains of a field in an specific table

  • I have a program to document a sql database , part of the program is using select to the SCHEMA and part of it is using DMO, table structure with field types, lenght , and so on , i am using the select against the schema but it seems that the checks are not store there, I am forced to use DMO.

    But DMO slowes the process, at least at my programming environment VFP9

    so I wonder if you guys know how to get the checks constarins of a field using t-sql?

  • Check constraints are applied at the Table level:

    Select ctu.TABLE_NAME, cc.CHECK_CLAUSE

    From INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE as ctu

    Join INFORMATION_SCHEMA.CHECK_CONSTRAINTS as cc

      on (ctu.CONSTRAINT_CATALOG = cc.CONSTRAINT_CATALOG and

          ctu.CONSTRAINT_SCHEMA  = cc.CONSTRAINT_SCHEMA  and

          ctu.CONSTRAINT_NAME    = cc.CONSTRAINT_NAME)

     

     

     

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

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