Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | learzbuStarting Member
 
 
                                        27 Posts | 
                                            
                                            |  Posted - 2013-07-25 : 04:48:11 
 |  
                                            | Hi, I'm trying to update to a table that contains almost 50 NOT NULL columns, but I only  need to enter values in 8 fields. The front end application auto generates a space field ' ' to enter blank values into these empty columns. I'm trying to auto generate a script that will update the tables with the values that I need. Can I run some kind of loop that will enter a space ' ' into any column I leave blank? or do I need to enter this space manually? |  |  
                                    | visakh16Very Important crosS Applying yaK Herder
 
 
                                    52326 Posts | 
                                        
                                          |  Posted - 2013-07-25 : 04:58:59 
 |  
                                          | if they're NOT NULL fields what you can do is attach a default constraint on them to make default value as ''. then include only required columns in your update others will get '' as value by default. Once your update is over you may revert it to how it was before by changing default constraints------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |  
                                          |  |  |  
                                    | madhivananPremature Yak Congratulator
 
 
                                    22864 Posts |  |  
                                |  |  |  |