Hi On Wed, Feb 11, 2009 at 9:52 AM, Clovis Fabricio <nos...@gmail.com> wrote:
> > 2009/2/11 Michael Bayer <mike...@zzzcomputing.com>: > > > > > > On Feb 11, 2009, at 8:43 AM, Clovis Fabricio wrote: > > > >> > >> 2009/2/11 Clovis Fabricio <nos...@gmail.com>: > >>> 2009/2/10 Michael Bayer <mike...@zzzcomputing.com>: > >>>>> Question is: How can I do that in a sa.Table constructor? > >>>>> sa.Table('DataB.dbo.TableInB', metadata, ....) > >>>>> sa.Table('TableInB', metadata, ...., schema='DataB.dbo') > >>>>> And both failed. Is there a way to map tables from both databases > >>>>> using the same engine? So I can do a JOIN between the tables? > >>>> you should use the "schema" argument. Define "failed" ? > >> >>> tb = sa.Table('TableInB', metadata, ...., schema='DataB.dbo') > >> >>> print tb.insert() > >> INSERT INTO [DataB.dbo].[TableInB] ([field1], [field2]) VALUES (?, ?) > >> It should be "[DataB].[dbo].[TableInB]" > >> I got it to work by using: > >> sa.Table('DataB.dbo.TableInB', metadata, ...., quote=False) > >> or > >> sa.Table('TableInB', metadata, ...., schema='DataB].[dbo') > >> but both are damn ugly!! > > I think perhaps there's a way to configure your database such that you > > wouldn't need the "dbo" segment ? > > Thank you for the answer. > > Well, I am using SQLServer 2000. I don't see this option. Dropping the > dbo part gives me this error: > SQL 2000 doesn't really support schemas, but the idea of an owner. There's a ticket in trac that discussed ideas around how we handle the owner segment for 2000 and before. MSSQL dialect should use the schema, owner, and name of a table to compose the table's name <http://www.sqlalchemy.org/trac/ticket/594> -- Michael Trier http://blog.michaeltrier.com/ http://thisweekindjango.com/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---