Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Location
    Lund, Sweden
    Posts
    8

    Unanswered: Remove default value from a table

    Hi there.

    I cannot figure this out, please help.

    I have a table with an attribute with a default value. How do I erase this default value (with sql). I do not want to lose any data in my table.

  2. #2
    Join Date
    Oct 2002
    Location
    Lund, Sweden
    Posts
    8
    I didn't get that to work, it said I should use ALTER TABLE DROP CONSTRAINT. I have tried that before but without success.

    But after a few minutes (almost an hour) I found a way to solve it:

    ALTER TABLE voucher DROP CONSTRAINT DF__voucher__voucher__56D3D912;

    The Constraint name I found by looking in the sysobjects table.

    Thanks anyway!

  3. #3
    Join Date
    Oct 2001
    Location
    England
    Posts
    426
    just do an alter table ... alter column ... and omit the default.

Posting Permissions

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