Automatically joining the tables using the foreign keys in SQL server, pyodbc
<p>I access a database of SQL server using python. The database has around 200 tables, and it contains foreign keys between the tables.</p>

<p>I want to join the tables automatically using the foreign keys that are in the database, since doing it by hand is very tedious. </p>

<p>How can I create pandas dataframes of all the maximal possible joins of tables using the given foreign keys?</p>

<p>With pyodbc, I can successfully get each specific table after creating a connection with this line of code:</p>

<pre><code>cnxn = pyodbc.connect("...")
</code></pre>