I want to add constraint for existing column

  • sir I want to add constraints like (not null unique primary key etc )

    in existing column so what can i do

    I use MS SQL SERVER

    plz give me exam of

    alter table alter column

  • For not null, it'll be an ALTER TABLE <Table Name> ALTER COLUMN ...

    The other two will be forms of ALTER TABLE <Table Name> ADD CONSTRAINT ...

    If you look up ALTER TABLE in books online, you'll find the detailed syntax for both.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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