Use Interactive SQL (dbisql) to run the TAQ, Interday, and Historical market data query scripts on your historical database.
dbisql allows you to type a SQL statement and send it to a database. Because interactions with databases use SQL statements, you can carry out any database operation from dbisql.