Tag History to CSV and Back how do i fix ignition crash?

Inserting a row at a time is going to be less efficient. A series of ops should be something like:

csvRead = csv.reader(csvFile),
csvDataset = []
count = 0
for row in csvRead:
    csvDataset.append(row)
    count += 1
    if count >= 1000:
    	insert_into_DB_here()
    	csvDataset = []
    	count = 0
if count>0:
	last_insert_into_db()

csvFile.close()

If you use system.db.runPrepUpdate to insert your rows, I do have a helper function to create the question marks for you.