set default

  • Hi,

    I've been trying to use the following code to set up a default on an existing column. It seems like it should be pretty simple, but it just doesn't work. I keep getting the following error: Incorrect syntax near the keyword 'set'. Anyone see the problem?

    alter table tablename alter column columnname set default value

  • This is the syntax we use

    ALTER TABLE tablename ADD

    CONSTRAINT constraint_name DEFAULT (newid()) FOR column_name


    Regards,

    Steve

    Life without beer is no life at all

    All beer is good, some beers are just better than others

  • Thanks Steve.  I'll give that a try.

    Brent

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

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