title: variable decimal places in sql
body: <p>How do you make it so that all calculations in the DB compute to a pre-specified # of decimal places?  Say I have three tables with the following fields </p>
  
  <h2>Table1</h2>
  
  <ul>
  <li>A int</li>
  <li>B decimal(18, 3)</li>
  </ul>
  
  <h2>Table2</h2>
  
  <ul>
  <li>A int</li>
  <li>B decimal (18, 2)</li>
  <li>C decimal (18, 3)</li>
  </ul>
  
  <h2>Table3</h2>
  
  <ul>
  <li>A int</li>
  <li>Precision int</li>
  </ul>
  
  <p>Now I need to change it so that all my calculations are based on what precision is set for A in Table3.  I started by converting all my decimals to decimal (30, 10) to allow for higher precisions if specified.  </p>