So, I’ve already created my database, but now need to add a default value to a field in a table. I would like to know how to do this without having to drop half my tables and constraints.
I looked online and it said to use this:
ALTER TABLE TABLE_NAME
ALTER COLUMN ColumnName
SET DEFAULT 1234;
I tried using that, however, and I’m getting “Incorrect syntax near the keyword ‘SET’.” Am I missing something terribly obvious?
Oh, and I guess I should add that the column I’m trying to edit is a foreign key, if that changes anything.
Thanks in advance,
Ellie
If you need to add a foreign key