<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">It is possible for a MSSQL connection attached to one database to reference objects in another database by using the objects' full names in the form, &lt;database_name&gt;.&lt;owner_name&gt;.&lt;table_name&gt;. The schema.Table constructor takes a schema argument and an owner argument already. These arguments should be used so that the schema argument takes the place of the database name in the format described above.</p>
<p dir="auto">So the following table definition:</p>
<p dir="auto">t = Table('a_table', meta, Column('col1', Integer), Column('col2', Integer), schema='database_name', owner='owner_name')</p>
<p dir="auto">and select construction:</p>
<p dir="auto">select(<a href="t">t</a>)</p>
<p dir="auto">would yield the following SQL when compiled:</p>
<p dir="auto">SELECT a_table_xxxx.col1, a_table_xxxx.col2<br>
FROM database_name.owner_name.a_table<br>
AS a_table_xxxx</p>
<p dir="auto">Please find included a simple test case that demonstrates the desired behavior.</p>
<hr>
<p dir="auto">Attachments: <a href="../wiki/imported_issue_attachments/594/test_mssql_naming_scheme.py">test_mssql_naming_scheme.py</a></p>
<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">Please find attached some diffs which go towards supporting multipart schema names. Background discussion can be found on a thread on the sqlalchemy group:</p>
<p dir="auto"><a href="http://groups.google.com/group/sqlalchemy/browse_frm/thread/e34ff8fed2c5be2a" rel="nofollow">http://groups.google.com/group/sqlalchemy/browse_frm/thread/e34ff8fed2c5be2a</a></p>
<p dir="auto">I added a couple of new tests in test/dialect/mssql.py</p>
<hr>
<p dir="auto">Attachments: <a href="../wiki/imported_issue_attachments/1341/1341.patch">1341.patch</a> | <a href="../wiki/imported_issue_attachments/1341/sa_multipart_schema.patch">sa_multipart_schema.patch</a></p>