What are the pre-requisites to modify datatype of a column and to add a column with NOT NULL constraint

Showing Answers 1 - 7 of 7 Answers

harsha

  • Jul 29th, 2005
 

1) to modify datatype of a column - ???  
2) to add a column with NOT NULL constraint - the table must have 0 rows

  Was this answer useful?  Yes

to modify the datatype of a column that should be empty, but if increasing the width then it can be done even it holds the value.

to add then not null column the table must be empty if not then add the column as nullable then modify that that column as not null.

  Was this answer useful?  Yes

Mukul

  • Jun 19th, 2007
 

We can update the datatype of column with ALTER function but the constraints cant be added with the ALTER function if there is data in the table.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions