Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Alter Table and Column to Allow Nulls Expand / Collapse
Author
Message
Posted Tuesday, April 23, 2002 11:59 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, March 14, 2003 12:00 AM
Points: 8, Visits: 1
What is the software command to modify the constraints on a foreign key to allow nulls and then restore the constraints?




Post #3742
Posted Tuesday, April 23, 2002 12:47 PM
SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: Moderators
Last Login: Today @ 1:24 PM
Points: 8,370, Visits: 743
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)



Post #32252
Posted Tuesday, April 23, 2002 1:10 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, March 14, 2003 12:00 AM
Points: 8, Visits: 1
The second part of your response answered my question (just as I thought).

Thank you for your prompt response.




Post #32253
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse