<class 'pyodbc.ProgrammingError'> ('42000', "[42000] [Microsoft][ODBC SQL 
Server Driver][SQL Server]ALTER TABLE only allows columns to be added that 
can contain nulls, or have a DEFAULT definition specified, or the column 
being added is an identity or timestamp column, or alternatively if none of 
the previous conditions are satisfied the table must be empty to allow 
addition of this column. Column 'name__tmp' cannot be added to non-empty 
table 'customers' because it does not satisfy these conditions. (4901) 
(SQLExecDirectW)")

I had a table that existed previously, but I wanted to add a 'notnull=True' 
constraint to it. Apparently, I am not allowed to do that because I get 
this error (SQL 2005).

Is there a workaround? This is 1.99.7.

Reply via email to