Alter Table and Column to Allow Nulls

  • What is the software command to modify the constraints on a foreign key to allow nulls and then restore the constraints?

  • I believe it is simply

    ALTER TABLE tblName ALTER COLUMN colName NULL

    on the table with the foreign key reference. Or are you wanting to enable allow nulls for the duration then put back as I don't believe you can if you column is null when done unless you are going to fix the data befor turning not null back on.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • The second part of your response answered my question (just as I thought).

    Thank you for your prompt response.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply