Hi,

>>Try adding autoincrement=False to the t_year column.
>>    
>>
>why would this fix the issue exactly ?
>  
>
Fair question. The explanation is a bit convoluted, not as nice and 
simple as the fix.

MSSQL's equivalent of SERIAL/autoincrement is an "identity" flag on a 
column. To insert an explicit value into that, you have to issue "set 
identity_insert <table> on". The MSSQL dialect does this for you 
automatically, and that was the statement failing in Paulino's example. 
The MSSQL dialect also automatically gives a column the identity flag if 
it's an integer primary key, and autoincrement is true. So it would have 
for t_year. Paulino is using table reflection, and I reckoned the real 
db table does not have the identity flag - it would certainly be odd to 
put that on a year column.

Regards,

Paul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to