title: Counting the total number of characters in a SQL table
body: <p>I want to count the total number of characters in a table.</p>
  
  <p>I know how to do it for one column:</p>
  
  <pre><code>select sum(leng)
  from (
      select len(column) as leng
      from table
  ) as Total
  </code></pre>
  
  <p>But how do I do this for every column in a table?</p>
  
  <p>One way I have thought of is </p>
  
  <pre><code>select sum(len(col1) + len(col2) + len(3) + ...) as TotalChracters
  from Table
  </code></pre>
  
  <p>But I need to do this for over 500 tables, and each table has a lot of columns. I was hoping for a general code that works for one table which I can easily loop over in Python by just changing the table name on each loop.</p>