[sqlalchemy] Re: MSSQL dislikes schema= on table.create()

2008-05-19 Thread Luis Bruno

Rick Morrison escreveu:

> So now I'm of two minds about which module to use and if I should use
> a schema or not for these porposes.

There's a few arcane limitations when using the pymssql module, pyodbc
will be better-supported going into the future. As for using schema vs.
other namespace tricks, that's up to you. I would stick with schemas -
SA includes good schema support.


Got it!


> had a broken exception message

Does anyone know what the story is with pyodbc and mangled tracebacks? 
That sounds kind of disturbing, like a corrupted stack or otherwise 
scrambled frame data inside of the Python interpreter.


To be honest, I was hoping that someone would whack me over the head and 
tell me it's a local problem... So you've seen the same problem, yes? 
I'll try and install everything in a clean VM, but not today.




signature.asc
Description: OpenPGP digital signature


[sqlalchemy] Re: MSSQL dislikes schema= on table.create()

2008-05-19 Thread Rick Morrison
> So now I'm of two minds about which module to use and if I should use
> a schema or not for these porposes.

There's a few arcane limitations when using the pymssql module, pyodbc will
be better-supported going into the future.
As for using schema vs. other namespace tricks, that's up to you. I would
stick with schemas - SA includes good schema support.

> had a broken exception message

Does anyone know what the story is with pyodbc and mangled tracebacks? That
sounds kind of disturbing, like a corrupted stack or otherwise scrambled
frame data inside of the Python interpreter.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: MSSQL dislikes schema= on table.create()

2008-05-19 Thread Paul Johnston
Hi,

So now I'm of two minds about which module to use and if I should use a
> schema or not for these porposes.


I'm using PyODBC and schemas, and things work just fine for me. Ok, some
error messages aren't quite there, but it works well enough for me.

Paul

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: MSSQL dislikes schema= on table.create()

2008-05-19 Thread Luis Bruno

Paul Johnston escreveu:
This isn't an SQLAlchemy or DBAPI issue - you just need to create the 
schema with the correct permissions.
True; I've already solved the problem, after I got this (much better) 
error message by using pymssql. The first traceback:


   * happened in a "SET IDENTITY ..." instruction, not on a "CREATE
 TABLE..."
   * had a broken exception message

So now I'm of two minds about which module to use and if I should use a 
schema or not for these porposes.




signature.asc
Description: OpenPGP digital signature


[sqlalchemy] Re: MSSQL dislikes schema= on table.create()

2008-05-19 Thread Paul Johnston
Hi,

The specified schema name "queer" either does not exist or you do not have
> permi
> ssion to use it.


This isn't an SQLAlchemy or DBAPI issue - you just need to create the schema
with the correct permissions.

Paul

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: MSSQL dislikes schema= on table.create()

2008-05-19 Thread Luis Bruno

Rick Morrison wrote:
I won't have a chance to look at this under pyodbc until tomorrow. In 
the meantime, if you could try with pymssql to see if you get the same 
error, that will help in debugging this.
What is the recommended module to use on win32? Yes, pymssql does help: 
I had to create the schema (wtfrak was I thinking...) Meanwhile, the 
stack trace isn't corrupted when using pymssql:


---8<---
 File 
"c:\python24\lib\site-packages\sqlalchemy-0.4.5-py2.4.egg\sqlalchemy\engi

ne\base.py", line 942, in _handle_dbapi_exception
   raise exceptions.DBAPIError.instance(statement, parameters, e, 
connection_in

validated=is_disconnect)
sqlalchemy.exceptions.DatabaseError: (DatabaseError) internal error: SQL 
Server

message 2760, severity 16, state 1, line 2:
The specified schema name "queer" either does not exist or you do not 
have permi

ssion to use it.
---8<---

Side note: I wish easy_install pymssql*.exe would have put ntwdblib.dll 
inside the .egg directory; that was a false start. Also, pymssql+SA 
doesn't support SSPI authentication using the syntax presented earlier:

mssql://:@host/db


Luis Bruno wrote:

File
"c:\python24\lib\site-packages\sqlalchemy-0.4.5-py2.4.egg\sqlalchemy\data 


bases\mssql.py", line 499, in do_execute
cursor.execute("SET IDENTITY_INSERT %s OFF" %
self.identifier_preparer.format_table(context.compiled.statement.table))
SystemError: 'finally' pops bad exception 
That error would be thrown by an insert, not a table create, and I 
believe there are other users using pyodbc with schema-specified 
tables without problems.
It happens on metadata.create_all(). Also, I've verified that "finally 
pops bad exception" happens on other exceptions, like failure to connect 
(this using pyodbc).





signature.asc
Description: OpenPGP digital signature


[sqlalchemy] Re: MSSQL dislikes schema= on table.create()

2008-05-19 Thread Rick Morrison
That error would be thrown by an insert, not a table create, and I believe
there are other users using pyodbc with schema-specified tables without
problems.

I won't have a chance to look at this under pyodbc until tomorrow. In the
meantime, if you could try with pymssql to see if you get the same error,
that will help in debugging this.

BTW, the "dbo" schema is implicit if you don't specify an explicit schema.

Rick

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---