Template TSV into SQL templates