Red Gate forums :: View topic - What's the problem with NOT NULL columns?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

What's the problem with NOT NULL columns?

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
DerekR



Joined: 27 Apr 2012
Posts: 3

PostPosted: Fri May 04, 2012 10:41 am    Post subject: What's the problem with NOT NULL columns? Reply with quote

Hi
Can someone explain what the big deal is with being unable to propogating new columns that are marked as NOT NULL?
Obviously, in the source DB these columns have data so isn't it just a case of dropping this constraint, altering the table (or drop/create), importing the data and reapplying the NOT NULL property?
I don't want to get into writing migration scripts and I think forcing me into taking the NOT NULL property off the source table, then reapplying can't be right either, I put it there for a reason.

Regards

Derek
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1124
Location: Twitter: @dtabase

PostPosted: Fri May 04, 2012 2:32 pm    Post subject: Reply with quote

The problem is that it's not possible to add the NOT NULL constraint to a table that has pre-existing data without doing an UPDATE to set the existing rows. SQL Compare can't second guess what these values should be.

David Atkinson
Red Gate
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group