Saturday, February 25, 2023

Changing NULL to NOT NULL of a Column Property  With  SQL Sever 2017 in Codes

Working with Database Management System (DBMS), we sometimes forgot some properties needed in a column while was creating a table. In this case, there is a Customer table which PositionID column needs to be changed from null to  not null property.

You can use keyword ALTER. Here is the example of the script.

ALTER TABLE Employee
ALTER COLUMN "PositionID"  TINYINT NOT NULL 




Don't forget, data type TINYINT still needs to be written after the column PositionID.


 

No comments:

Post a Comment