title: List table names
body: <p>I'm in the process of trying to migrate my ASPNET site to Django. All my current data is tied up in MS SQL Server on a shared host that (helpfully) doesn't support python... I could use my existing code to export all the data but I've also stopped using Windows. The site is mainly compiled VB.NET so I'd need to install Windows and Visual Studio and then figure out what I'm trying to do... I don't like that plan.</p>
  
  <p>Rather than go through <em>that</em> headache, I'd like to use PHP to export the entire database (or a table at a time) to JSON. SimpleJSON in Python will make it ludicrously easy to import so it seems like a plan.</p>
  
  <p>So far, so good. In PHP I've managed to connect to the SQL Server and perform simple queries, but I need a list of tables so I know what data I need to copy. I want all the tables because there are legacy tables from when I rewrote the site about three years ago, and I'd like to keep that data somewhere...</p>
  
  <p>So first thing: <strong>Does anybody know the SQL query for listing all tables?</strong></p>
  
  <p>I've tried <code>mssql_query('sp_tables');</code> but this returns a strange list:</p>
  
  <pre><code>mydatabasename
  mydatabasename
  dbo
  dbo
  syscolumns
  syscolumns
  SYSTEM TABLE
  SYSTEM TABLE
  </code></pre>
  
  <p>Secondly: In your opinion, would I be better off writing each table dump to its own .json file or should I keep it all together?</p>
  
  <p>Thirdly: Am I going about this the wrong way?</p>