title: Getting Default Constraints Information
body: <p>I am trying to get the Default Constraints information for a given table. I wrote something like this:</p>
  
  <pre><code>SELECT  c.name ,
          col.name
  FROM    Rem.sys.default_constraints c
          INNER JOIN Rem.sys.columns col ON col.default_object_id = c.object_id
          INNER JOIN Rem.sys.objects o ON o.object_id = c.parent_object_id
          INNER JOIN Rem.sys.schemas s ON s.schema_id = o.schema_id       
  WHERE   s.name = 'dbo'
          AND o.name = 'Desk_Hist'
  </code></pre>
  
  <p>But it doesn't return me the default value. So I tried a different way and the query is:</p>
  
  <pre><code>SELECT *
                  FROM    Rem.information_schema.columns columns
                  WHERE   columns.table_catalog = 'Rem'
                          AND columns.table_schema = 'dbo'
                          AND columns.table_name = 'Desk_Hist'
                          AND COLUMN_DEFAULT IS NOT NULL  
  </code></pre>
  
  <p>But it returns me nothing.</p>
  
  <p>Can anyone help me on this?</p>