T-SQL Tutorial

Msg 173 Level 15 - The definition for column must include a data type


On Transact SQL language the Msg 173 Level 15 - The definition for column must include a data type - means that you must write the data type for the new column.

Msg 173 Level 15 Example:

Invalid alter table:

USE model;
GO
ALTER TABLE students ADD dep_id;
GO

Message
Msg 173, Level 15, State 1, Line 1
The definition for column 'dep_id' must include a data type.




Correct alter table:

USE model;
GO
ALTER TABLE students ADD dep_id INT;
GO

Message
Command(s) completed successfully.

Other error messages: