Alter Column

suggest change
ALTER TABLE Employees
ALTER COLUMN StartingDate DATETIME NOT NULL;

ALTER TABLE Employees
ADD CONSTRAINT DF_StartingDate DEFAULT (GETDATE()) FOR StartingDate;

On SQL Server, the first statement changes StartingDate from date to datetime and disallows NULL. ALTER COLUMN cannot set a default, so the second statement adds one. GETDATE() and FOR are SQL Server syntax.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents