Just tried it here on a Linux + pymssql box and it worked fine.

The 'NoSuchTable' error would indicate that the table is not found, as you
surmised. Check to make sure the table is really persisting after your first
session with the table create.  In the meantime, I'll see if I can get
pymssql running on Windows to see if I can replicate the problem here.

Rick


On 6/12/07, one.person <[EMAIL PROTECTED]> wrote:
>
>
> Hello all
>
> I am experimenting with SA on MSSQL and am having difficulty with
> table reflection as outlined in the tutorial, for instance:
>
> from sqlalchemy import *
> db = create_engine('mssql://login:[EMAIL PROTECTED]/db')
> metadata = BoundMetaData(db)
>
> users_table = Table('users', metadata,
>         Column('user_id', Integer, primary_key=True),
>         Column('user_name', String(40)),
>         Column('password', String(10))
>         )
>
> metadata.engine.echo = True
> users_table.create()
>
> All of this works fine, it creates the 'users' table no problem, but
> if I come back and try this it returns a NoSuchTableError:
>
> users = Table('users', metadata, autoload=True)
>
> Traceback (most recent call last):
>   File "<pyshell#3>", line 1, in -toplevel-
>     users = Table('users', metadata, autoload=True)
>   File "build\bdist.win32\egg\sqlalchemy\schema.py", line 166, in
> __call__
>   File "build\bdist.win32\egg\sqlalchemy\engine\base.py", line 809, in
> reflecttable
>   File "build\bdist.win32\egg\sqlalchemy\databases\mssql.py", line
> 506, in reflecttable
> NoSuchTableError: users
>
> With a little searching around I also tried the schema='' argument and
> the owner='' argument on Table() with the same error.  I tried the
> exact same thing on mysql and it worked perfectly.
>
> There must be something obvious that I am doing wrong here, or
> something specific to mssql, any tips?  (This is MSSQL2000 server +
> pymssql on a windows client, python 2.4.2 btw)
>
> Thanks in advance
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to