查找指定表、字段上面的默认值约束

查找myuser表上面的isadmin字段上面的默认值约束,查询sql如下:

 SELECT  name
FROM    sys.default_constraints
WHERE   parent_object_id = OBJECT_ID('myuser')
        AND parent_column_id = COLUMNPROPERTY(OBJECT_ID('myuser'), 'isadmin',
                                              'ColumnId' )

 

posted @ 2016-07-31 10:48  飘....  阅读(354)  评论(2编辑  收藏  举报