Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    88

    Unanswered: Default constraints

    Does anyone know a query that will return the value defined on a default constraint for a database table.column ?

    So, if I have table :

    create table #bill (
    column1 int not null,
    column2 char(4) default 'AAAA'
    )

    Something that would give me the 'AAAA' back ?

    Thanks,

    Bill

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Select column_default
    from Information_Schema.Columns
    where table_name = 'table_name' AND
    column_name = 'column'
    Last edited by r123456; 02-10-04 at 09:51.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Feb 2004
    Posts
    88
    Thank you very much,

    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •