db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Devaney (JIRA)" <j...@apache.org>
Subject [jira] Created: (DDLUTILS-202) Changing a column from null to not null causes loss of data
Date Tue, 08 Apr 2008 19:29:27 GMT
Changing a column from null to not null causes loss of data
-----------------------------------------------------------

                 Key: DDLUTILS-202
                 URL: https://issues.apache.org/jira/browse/DDLUTILS-202
             Project: DdlUtils
          Issue Type: Bug
          Components: Core - SqlServer
         Environment: Microsoft SQL Server 2005
            Reporter: Brian Devaney
            Assignee: Thomas Dudziak


If there is a table wil a column that can be null and has data and the column definitioin
will try to make it not null, the update script will not transfer the data to the new table
properly.  All rows that have a null value in the nullable column will not transfer to the
new not null column, even if a defautl value is used.  The temprary table will be created,
but the insert command that moves the data from one table to another will fail.  In Microsoft
SQL, if the value in the colum nis null, that will be the value that is inserted into the
temporary table.  The default value that is a part of that table will not be used by the sql
command.   The end result is that rows with null values will be lost. 

It is unknown at this time if this is a Microsoft SQL server issue only or if this occurs
on other databases as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message