Thanks a lot for the help guys.  I got this to work by specifying the
schema="" argument properly.  It turns out I had to specify the
'schema' argument to Table() as what MSSQL refers to as the 'Owner' of
the table in enterprise manager.

Still confused over the difference between schema and owner in MSSQL,
but now at least it works!

Thanks again

On Jun 12, 7:05 pm, "Rick Morrison" <[EMAIL PROTECTED]> wrote:
> That looks OK to me.
>
> Try pasting that query (cleaned-up) into a query window on Enterprise
> Manager and see what kind of results you get. The "?" arguments are
> positional, so the first would be the table 'zone'; the second the schema
> 'dbo'.
>
> On 6/12/07, one.person <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks for all the quick replies.  Currently on pyodbc 2.0.3.6.
>
> > Anyway, I tried this (the table 'zones' most definitely exists):
>
> > >>> metadata.engine.echo = True
> > >>> zones_table = Table('zones', metadata, autoload=True)
>
> > 2007-06-12 18:20:40,924 INFO sqlalchemy.engine.base.Engine.0x..b0 SET
> > nocount ON
> > 2007-06-12 18:20:40,924 INFO sqlalchemy.engine.base.Engine.0x..b0 None
> > 2007-06-12 18:20:40,924 INFO sqlalchemy.engine.base.Engine.0x..b0
> > SELECT [COLUMNS_eba4].[TABLE_SCHEMA], [COLUMNS_eba4].[TABLE_NAME],
> > [COLUMNS_eba4].[COLUMN_NAME], [COLUMNS_eba4].[IS_NULLABLE],
> > [COLUMNS_eba4].[DATA_TYPE], [COLUMNS_eba4].[ORDINAL_POSITION],
> > [COLUMNS_eba4].[CHARACTER_MAXIMUM_LENGTH], [COLUMNS_eba4].
> > [NUMERIC_PRECISION], [COLUMNS_eba4].[NUMERIC_SCALE], [COLUMNS_eba4].
> > [COLUMN_DEFAULT]
> > FROM [INFORMATION_SCHEMA].[COLUMNS] AS [COLUMNS_eba4]
> > WHERE [COLUMNS_eba4].[TABLE_NAME] = ? AND [COLUMNS_eba4].
> > [TABLE_SCHEMA] = ? ORDER BY [COLUMNS_eba4].[ORDINAL_POSITION]
> > 2007-06-12 18:20:40,940 INFO sqlalchemy.engine.base.Engine.0x..b0
> > ['zones', 'dbo']
>
> > Traceback (most recent call last):
> >   File "<pyshell#6>", line 1, in -toplevel-
> >     zones_table = Table('zones', 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: zones
>
> > I think that was what you guys meant by query logging....


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