title: Windows batch SQL query, database name includes percentage sign (%)
body: <p>I've been using batch files with RazorSQL to query hosted Cache databases for certain data. I want to use the same process to collect the current backup times for Cache. The big difference is this data is stored in a system namespace that has a percent sign % in the name. The query looks like this:</p>
  
  <blockquote>
    <p>Select * from %sys.task where name like '%Backup%'</p>
  </blockquote>
  
  <p>This works fine from RazorSQL. But when I put it in a batch file, it fails because of the % sign. The batch file looks like this (which is very similar to other stuff I use successfully against regular database names):</p>
  
  <blockquote>
    <p>"C:\Reporting\Casecount\RazorSQL\jre\bin\java" -jar
    "C:\Reporting\Casecount\RazorSQL\razorsql.jar" -export "Tst_Bkup" "Select
    * from %sys.task where name like '%Vision%'" csv NO</p>
  </blockquote>
  
  <p>When you run this in a command window, you can see it parse out arguments, but the argument for the query comes out as this:</p>
  
  <blockquote>
    <p>args[2]: Select * from Vision'</p>
  </blockquote>
  
  <p>It basically skips from the first % to the 2nd %, and ignores everything in between. Against normal database names you'd see the query in this argument correctly.  I've tried quotes, double quotes, brackets, exclamation points, etc, and can't get it to pass a % into the argument. I'm not a coder by trade, so I'm out of my depth here.</p>