2009/2/11 Michael Bayer <[email protected]>: > > > On Feb 11, 2009, at 8:43 AM, Clovis Fabricio wrote: > >> >> 2009/2/11 Clovis Fabricio <[email protected]>: >>> 2009/2/10 Michael Bayer <[email protected]>: >>>>> 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 Server]Invalid object name 'DataB.TableInB'. (208) (SQLExecDirectW) I will keep trying to find an option to not need the schema name. nosclo --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
