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