|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Retrospectivly apply a default constraintI have the code below which will add the default constriant I want. Is there
anyway to make it apply retrospectivly to the existing records? ALTER TABLE JOB WITH CHECK ADD CONSTRAINT [Setpermanent] DEFAULT 'P' FOR USR_VB_JOBTYPE Russell wrote:
> I have the code below which will add the default constriant I want. Is there Isn't it just simply:> anyway to make it apply retrospectivly to the existing records? > > ALTER TABLE JOB WITH CHECK ADD CONSTRAINT [Setpermanent] DEFAULT 'P' FOR > USR_VB_JOBTYPE UPDATE JOB SET USR_VB_JOBTYPE = 'P' WHERE USR_VB_JOBTYPE IS NULL ....or am I missing something! Regards, -Tav.- Tavis Pitt |
|||||||||||||||||||||||