I HAVE FOLLOWING QUERY... THROUGH WHICH I WANT TO ALTER DEFAULT VALUE
ALTER TABLE MBR_MST2 ALTER COLUMN MBR_STS SET DEFAULT 1
don't know why it is showing an error Incorrect syntax near the keyword 'SET'.
I HAVE FOLLOWING QUERY... THROUGH WHICH I WANT TO ALTER DEFAULT VALUE
ALTER TABLE MBR_MST2 ALTER COLUMN MBR_STS SET DEFAULT 1
don't know why it is showing an error Incorrect syntax near the keyword 'SET'.
The query as follows will sort it out. Refer the below handy code sample has been written by Pinal Dave
ALTER TABLE MBR_MST2
ADD CONSTRAINT MBR_MST2_CONST DEFAULT 1 FOR MBR_STS
Use ADD CONSTRAINT
ALTER TABLE MBR_MST2 ADD CONSTRAINT DF_NewSTS DEFAULT 1 FOR MBR_STS;
Read the documentation for your statement. Your error is correct, the syntax is incorrect.
Look at this question for the correct syntax.
ALTER TABLE MBR_MST2 ADD CONSTRAINT Your_Constraint_Name DEFAULT 1 FOR MBR_STS
ALTER TABLE MBR_MST2 ALTER COLUMN MBR_STS SET DEFAULT 1
Rewrite as
ALTER TABLE MBR_MST2
add constraint DF_MBR_MST2_MBR_STS
Default 'DEFAULT 1' For MBR_STS
Open your table and refresh it's constraints folder and this constraint should be there.