Looks like the workaround is adding a "requires=IS_NOT_EMPTY()" so the
field definition.
On Tuesday, May 8, 2012 3:39:36 PM UTC-7, Derek wrote:
>
> <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.
>