equivalent column in sql server 2005 for cdefault column of syscolumns table

  • dear all

    Is there any view in which any column show the default value of any table's column. which is equivalent to cdefault column in syscolumns table. i know information_schema.columns view. is there any other view which shows column default value.

  • yep already created view for you. try

    SELECT * FROM INFORMATION_SCHEMA.COLUMNS

    you'll see it has the definitions for all the columns int he database, including what that default value is.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Sys.columns has a default_object_id. This is the id of the default, which you can access via the sys.default_constraints system view. The sys.default_constraints shows the definition of the default in the "definition" column.

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

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

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