Their perseverance through the past 19 months of COVID-19 turmoil has allowed AZZ to obtain the results we are now reporting.
Overall sales of $216 million improved 6.4% versus the prior year, or 8% when adjusted for the divestiture of SMS. Metal Coatings turned in another excellent quarter with sales up 10.7%, almost $130 million, and Infrastructure Solutions flat at about $87 million.
We generated net income of $18.9 million and earnings per share of $0.76 per diluted share, reflecting the resiliency of our businesses and the dedication of our people.
We also benefited from lower interest expense while incurring a 20.4% tax rate for the quarter.
In line with our strategic commitment to value creation, we've repurchased over 290,000 shares for $15 million and distributed $4.2 million in dividends.
In Metal Coatings, which represented 60% of our sales in the second quarter, we achieved 24.4% operating margins on sales of $130 million.
This resulted in operating income being up over 17% from the previous year.
We were up about 4.3% when considering the impact of the SMS divestiture.
The team delivered operating income of $7 million or 130%, up dramatically versus the prior year.
We anticipate sales to be in the range of $865 million to $925 million and earnings per share at $2.90 to $3.20.
Bookings or incoming orders in the second quarter were $231.8 million, a $23.2 million or a 11.1% increase over the second quarter of the prior year.
Our bookings to sales ratio increased to 107% as we saw improving market conditions across both the Metal Coatings and Infrastructure Solutions segments.
As Tom previously mentioned, second quarter fiscal year 2022 sales of $216.4 million were $13.1 million or 6.4% higher than the prior year second quarter sales of $203.4 million.
We generated gross profit of $55.1 million compared with gross profit of $46.1 million in the second quarter of the prior year.
Our gross margin was 25.5% for the quarter, which was a 280-basis-point improvement compared with a gross margin of 22.7% in the second quarter of last year, as business in both segments continues to recover from the pandemic lows witnessed this time last year.
Operating income for the quarter was $26.5 million compared with $652,000 in the second quarter of the prior year.
During the prior year second quarter, we recorded restructuring and impairment charges of $18.7 million.
Our earnings per share of $0.76 was $0.26 higher than last year's second quarter adjusted earnings per share of $0.50 and $0.83 above the reported loss of $0.07.
Second quarter EBITDA for fiscal year 2022 was $36.6 million compared with adjusted EBITDA reported in the second quarter of fiscal year 2021 of $30.7 million, an increase of $5.9 million or 19.1%.
Year-to-date sales through the second quarter of fiscal year 2022 were $446.3 million, a 7.1% increase from last year's second quarter year-to-date sales of $416.7 million.
Excluding the impact of the SMS divestiture, sales would have increased 11% year-over-year.
Fiscal year 2022 year-to-date net income of $41.3 million was $22.8 million or 122.8% above the prior year-to-date adjusted net income of $18.5 million.
Prior year-to-date net income as reported was $3.8 million.
Year-to-date earnings per share of $1.64 was 131% higher than the prior year-to-date adjusted earnings per share of $0.71.
The following are our capital allocation highlights: During the quarter, we renegotiated and renewed our five-year credit facility, retaining our facility at $600 million in borrowing capacity, supported by a strong group of banks.
Gross outstanding debt as of the second quarter is $183 million, $4 million above the $179 million in outstanding debt at the end of the second quarter of the prior year, which reflects increased share purchase activity as we have purchased nearly 70 million in outstanding shares during the last year.
Year-to-date, we have deployed $13.1 million in capital investments and we anticipate to still make capital investments of roughly $35 million this year.
As Tom noted, we repurchased $15 million in outstanding stock during the quarter and $21.2 million on a year-to-date basis.
For the first half of the year, cash flow from operations was $37.8 million, up $5.6 million or 17.4% from prior year as a result of strong sales and solid net income generated by the business.
Free cash flow was $23.2 million, $10.3 million or 79.8% above the $12.9 million realized in the prior year.
We remain committed to our growth strategy around Metal Coatings and achieving 21% to 23% operating margins with galvanizing performance being quite steady, while we continue to improve Surface Technologies.

Summary:
We generated net income of $18.9 million and earnings per share of $0.76 per diluted share, reflecting the resiliency of our businesses and the dedication of our people.
We anticipate sales to be in the range of $865 million to $925 million and earnings per share at $2.90 to $3.20.
As Tom previously mentioned, second quarter fiscal year 2022 sales of $216.4 million were $13.1 million or 6.4% higher than the prior year second quarter sales of $203.4 million.
Our earnings per share of $0.76 was $0.26 higher than last year's second quarter adjusted earnings per share of $0.50 and $0.83 above the reported loss of $0.07.