sql server : get default value of a column

Posted by luke on Stack Overflow See other posts from Stack Overflow or by luke
Published on 2010-04-07T08:56:12Z Indexed on 2010/04/07 9:03 UTC
Read the original article Hit count: 373

Filed under:
|
|

Hello, I execute a select to get the structure of a table. I want to get info about the columns like its name or if it's null or if it's primary key.. I do something like this

....sys.columns c...
c.precision,
c.scale,
c.is_nullable as isnullable,
c.default_object_id as columndefault,
c.is_computed as iscomputed,

but for default value i get the id..something like 454545454 but i want to get the value "xxxx". What is the table to search or what is the function to convert that id to the value. Thanks

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server