Re: [sqlalchemy] pyodbc+mssql and implicit_returning: False: Is this a bug? Any work arounds?

2012-04-05 Thread Derek Litz
Good news! I was able to reproduce the exception after modifying your test script. Attached is my info and the script. Below is also repeated at the beginning of the two files. NOTE: You will need to edit connect_to_mssql() I was able to get the following error using this script.

Re: [sqlalchemy] pyodbc+mssql and implicit_returning: False: Is this a bug? Any work arounds?

2012-04-05 Thread Michael Bayer
Pyodbc's docs seem to be wrong as far as scope_identity() in any case, I seem to get back a number here whether I execute scope_identity() or select @@identity. The flag does what's expected in ra98001d03a2f, though you'll have to confirm it's working with that rather extreme trigger you have

Re: [sqlalchemy] pyodbc+mssql and implicit_returning: False: Is this a bug? Any work arounds?

2012-04-05 Thread Derek Litz
The use_scope_identity=False appears to be working as you've stated with the sqlalchemy version you've linked. No errors. I do, still, get the error without use_scope_identity=False, stack trace appears identical. Good question on the IDENTITY directive, I thought the exact same thing, but I'm

Re: [sqlalchemy] pyodbc+mssql and implicit_returning: False: Is this a bug? Any work arounds?

2012-04-05 Thread Michael Bayer
well you've circumvented the IDENTITY mechanics by doing an INSTEAD OF INSERT (first time I've ever seen that), and as a matter of course need to turn off IDENTITY INSERT which is part of mssqls overall ridiculousness in this area - so the IDENTITY feature really isn't being used here. But

[sqlalchemy] pyodbc+mssql and implicit_returning: False: Is this a bug? Any work arounds?

2012-04-02 Thread Derek Litz
Hello, First time using sqlalchemy against a table with triggers and it doesn't seem usable. Can anyone confirm or deny my situation as a bug, or enlighten me to my user error? First I ran into this issue: ERROR:root:Database Error Traceback (most recent call last): *File my_code...*

Re: [sqlalchemy] pyodbc+mssql and implicit_returning: False: Is this a bug? Any work arounds?

2012-04-02 Thread Michael Bayer
What SQL are you seeing, do you see ; select scope_identity() at the end of the INSERT statement ? that's how that works. Also software versions ? (SQLA, freetds, pyodbc). On Apr 2, 2012, at 5:27 PM, Derek Litz wrote: Hello, First time using sqlalchemy against a table with triggers

Re: [sqlalchemy] pyodbc+mssql and implicit_returning: False: Is this a bug? Any work arounds?

2012-04-02 Thread Michael Bayer
Also, attached is a test script based on our unit tests which illustrates the feature working as expected - can you run this on a test database on your end, and if it passes, try to modify the trigger/table def so that it reproduces your output ? the test creates/drops two tables and a