changed segment bulk insert to use sqlbulkcopy