Lambing Bugs

Note: this blog post was originally posted on lambtracker.com and has been moved here for preservation. Some information may be outdated.

We are nearing the end of lambing season. We only have six ewes yet to lamb, and this year, we uncovered a few more programming bugs. Most have been fairly minor – things like forgetting to update the sheep record for new lambs with fields for management group and location. Other fixes are on hold until lambing is done, since it’s working fairly well at the moment. I don’t want to break anything before the season is over.

I am also entering historical lambing data over time, and I’ve developed a workflow to get the information in. I’m going back to my original paper lambing books and cross-referencing with my calendar and spreadsheep records. I have the database up on another computer with all of the sheep sorted by dam, then birth date. I have a spreadsheet to insert lambing history records into, and I have a copy of the database I’m working on on a second computer.

The procedure is as follows:

  1. Look up a lambing record in the paper book and start creating the insert record in the update spreadsheet.
  2. Find the sheep_id for the dam, then use that to look at the other copy of the database and find all her lambs.
  3. Verify that the number of lambs in the database matches the paper record, and add the lamb numbers to the lambing_history_table record.
  4. Go to the historical calendar and pull any notes about that lambing. Add them to the record.
  5. Go into the sheep_table and add a reference to the soon-to-be-added lambing_history record to each lamb’s sheep record.
  6. When I have a batch of maybe ten or so done, I save the update spreadsheet as a .csv file, then run the CSV to SQL converter to create insert statements.
  7. Copy and paste the code into the database and execute it. Then, save a copy of the database as a backup.

I continue this until all lambing records are entered for the year. Then, I go to my population history records and figure out all the ewes who failed to lamb that year. I add a record that lists them as barren for that year. This gives a more accurate reporting percentage of lambs born and weaned.

My final verification step takes place after I’ve entered an entire year of the paper and calendar records. I pull up all of my old spreadsheets on the flock and look at lambing notes for that year. I make sure I have the right lambs and data in the lambing_history record. This final step happens at least a day after I’ve finished the original data entry – it’s my final chance to catch any data entry errors.

So far, I’ve managed to enter ten years of lambing records, and I only have seven years to go. It’s slow and tedious, but necessary.

Scroll to Top