MsSql table owner

10 views
Skip to first unread message

Theanoula

unread,
Nov 20, 2012, 10:02:17 AM11/20/12
to sqlal...@googlegroups.com
Hello!

I am trying to connect to a database as follows:

ENGINECOM  = create_engine('mssql+pyodbc://usr:pass@MyDSN')
METACOM    = MetaData(bind=ENGINECOM) 

COM_TABLE_ORDERHEADER   = Table('table', METACOM, autoload=True) 

My problem is that the table owner in MsSql database is different than 'dbo' , resulting in getting errors on the Selects I do. As much as I searched for, I couldn't find how/where to declare the owner.

Could you please help me in some way.

Thanks a lot.

Sincerely yours

Theanoula

Michael Bayer

unread,
Nov 20, 2012, 8:53:37 PM11/20/12
to sqlal...@googlegroups.com
best way is to change the default "owner" on your connection, short of that use the schema argument on table: Table('t', metadata, schema="myschema")


Reply all
Reply to author
Forward
0 new messages