Added SQL insert statement generation for periods