Lucas, Thanks for taking a peek at this!
My connection string looks like: 'mssql://user:p...@server/db? driver=FreeTDS_82&Servername=MyServer' where FreeTDS_82 is defined in my odbcinst.ini, and MyServer is defined in my freetds.conf. I've tried 'tds version = 8.0' and 'tds version = 7.0' in my freetds.conf, but still see the same behavior. I'm fairly certain both config files are being read correctly. Using FreeTDS 0.82, I see the exception as reported. Using FreeTDS 0.63, I see a slightly different exception: raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect) DBAPIError: (Error) ('HY000', 'The driver did not supply an error!') 'INSERT INTO activities (institution, application_id) VALUES (?, ?); select scope_identity()' ['UMass', 1] and the FreeTDS log includes: 17:28:26.864001 tds_submit_query(): state is PENDING 17:28:26.864015 tds_client_msg: #20019: "Attempt to initiate a new SQL Server operation with results pending.". Connection state is now 1. which suggests to me the same problem, just being caught in a different place. I should also mention that simpler tests (e.g., using the ORM to save an object with no relations) do succeed. -Tom On Apr 27, 12:18 pm, Lukasz Szybalski <szybal...@gmail.com> wrote: > On Mon, Apr 27, 2009 at 10:01 AM, Tom Wood <thomas.a.w...@gmail.com> wrote: > > > Hi all, > > > Am having a problem with SQLAlchemy 0.5.3 and MSSQL. Running on a > > Debian stack, using FreeTDS 0.82, pyodbc 2.1.4, Python 2.5 and > > (separately) SQL Server 2000 and SQL Server 2005. > > > The (nose) test below fails with the exception: > > > ProgrammingError: (ProgrammingError) ('24000', '[24000] [FreeTDS][SQL > > Server]Invalid cursor state (0) (SQLExecDirectW)') 'INSERT INTO > > activities (institution, application_id) VALUES (?, ?); select > > scope_identity()' ['UMass', 1] > > > Complete stack can be found below. > > > I'd love to hear from anyone running under a comparable configuration-- > > whether you see the same results or not! :-) > > > FYI: The test succeeds using SQLAlchemy 0.5.0rc3, but fails with every > > subsequent release. It also passes running against a sqllite db. > > > Thanks very much. > > > Tom Wood > > University of Connecticut > > > # begin test code > > > import sqlalchemy as sa > > from sqlalchemy import orm > > conn = 'mssql://<insert your string here>' > > engine = sa.create_engine(conn) > > I'm not sure if I can help but if we could start with the basics and > find out what version of tds are you using and how are you connecting? > > 1. Are you using dsn-less or dsn connection string? �...@dsn ? > 2. What tds version have you set in > /etc/freetds/tds.dsn.templatehttp://lucasmanual.com/mywiki/unixODBC > > Have you tried setting it to tds version 8.0? > > Thanks, > Lucas > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---