status in sysconstraints

When I do
*select distinct status  from sysconstraints

I get 4 digit and 5 digit numbers. what are they?

http://msdn.microsoft.com/en-us/library/aa260399%28SQL.80%29.aspx
suggest single digit values...
LVL 6
anushahannaAsked:
Who is Participating?
 
chapmandewCommented:
SELECT            sc.constid ConstraintID,
            so.name TableName,
            CASE WHEN sc.colid = 0 THEN '' ELSE s.name END ColumnName,
            SUBSTRING(
                        CASE WHEN sc.Status & 32 = 32 THEN ', Table-level' ELSE '' END +
                        CASE WHEN sc.Status & 16 = 16 then ', Column-level' ELSE '' END +
                        CASE WHEN sc.Status &  5 = 5 then ', DEFAULT' ELSE '' END +
                        CASE WHEN sc.Status &  4 = 4 then ', CHECK' ELSE '' END +
                        CASE WHEN sc.Status &  3 = 3 then ', FOREIGN KEY' ELSE '' END +
                        CASE WHEN sc.Status &  2 = 2 then ', UNIQUE KEY' ELSE '' END +
                        CASE WHEN sc.Status &  1 = 1 then ', PRIMARY KEY' ELSE '' END,
                   3, 100) + ' constraint'
FROM            sysconstraints sc
INNER JOIN      sysobjects so ON so.id = sc.id AND so.xtype = 'u'
LEFT JOIN      syscolumns s ON s.colid = sc.colid AND so.id = s.id
0
 
chapmandewCommented:
Looking..

in the mean time, you can use:  select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS
0
 
anushahannaAuthor Commented:
Thanks Genius!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.