James McDonald breezed through six nearly perfect innings and tried not to think about the no-hitter he was working on.

Maybe it's because the Pittsburgh Pirates right-hander was so focused on when his team was going to score some runs.

Not yet, apparently.

Troy Tulowitzki broke up McDonald's no-hit bid in the seventh and Tyler Colvin hit a go-ahead sacrifice fly in the eighth that lifted the Rockies to a 2-1 victory in Wednesday's doubleheader opener.

"It's always difficult," McDonald said. "We fought. It was a close, hard-fought game. You can't ask for more."

McDonald couldn't do much more while limiting the Rockies to one hit over seven innings, striking out eight and walking three. The 27-year-old tried not to think about pitching Pittsburgh's first no-hitter in nearly 15 years until after he was removed in the top of the eighth.

"I was like, 'man, two more innings is all I needed," McDonald said. "You're aware of it, but are you thinking about it pitch by pitch. I'd rather have the win or the no-hitter."

Colorado won despite squeezing out just three hits and only getting a runner to third three times.

"It's not often that you win a game with three hits," manager Jim Tracy said. "We rode very solid pitching and we took advantage of a momentary command lapse."

Matt Reynolds (2-0) won in relief of starter Juan Nicasio. Rafael Betancourt worked the ninth for his sixth save.

Chris Resop (0-2) lost after relieving McDonald in the eighth.

McDonald was nearly flawless before Tulowitzki's infield single with one on in the seventh. He received a warm ovation from the crowd but little offensive help.

The Pirates managed nine hits — heady territory for a team with a .211 batting average — but only scored on Pedro Alvarez's homer in the seventh.

Pittsburgh set an NL record and tied a major league mark by playing its 17th straight game starting the season in which neither team scored more than five runs, matching the standard set by the 1943 Detroit Tigers.

"They swung the bat, they put up hits," McDonald said. "They're still up their fighting."

McDonald flirted with the first Pirates no-hitter since Francisco Cordova and Ricardo Rincon combined over 10 innings against the Astros on July 12, 1997. His only stumble early came in the fifth, when he hit Jason Giambi with a pitch and then walked Michael Cuddyer. He wiggled out when he got Rosario to ground into a double play and struck out Chris Nelson.

McDonald wasn't so fortunate in the seventh. He walked Carlos Gonzalez on four pitches and Tulowitzki — who came in batting .383 in his career against the Pirates — hit a sharp grounder to third. Alvarez dived to his left to grab it only to see the ball smack off his glove.

The no-hitter gone, McDonald lost the shutout when a wild pitch advanced the runners and Giambi hit a long fly ball to center.

Alvarez, who came in with the lowest batting average (.108) of any Pittsburgh regular, continued his "all or nothing" approach, sending a Nicasio fastball over the wall in center to tie the score in the bottom of the inning.

The former first-round pick has just five hits this season but three of them are homers. It was the only mistake by Nicasio, who nearly matched McDonald pitch for pitch, giving up one run on nine hits in 6 2-3 innings, walking one and striking out five.

"(McDonald) was throwing a (shutout), so I tried to throw (a shutout)," Nicasio said. "It made me want to be in the competition."

The tie didn't last long. Resop threw a pitch that hit pinch-hitter Eric Young, who moved to third on Marco Scutaro's single. Colvin followed with a flyball to right off reliever Tony Watson, and Young just beat Jose Tabata's throw to the plate.

"I don't know if I could name another guy in the league that's going to score from third base on the ball that Colvin hit," Tracy said. "There's probably a couple other guys who would try, but it's less than five I guarantee you as far as guys who would take off from third on that fly to get us the run we needed to win."

NOTES: As part of the new collective bargaining agreement, both teams were allowed to add a roster spot for the doubleheader. The Pirates recalled reliever Jared Hughes from Triple-A Indianapolis while the Rockies brought up reliever Zach Putnam. Hughes pitched a scoreless ninth for Pittsburgh ... The Pirates are off Thursday then begin a six-game trip on Friday in Atlanta. A.J. Burnett (1-0, 0.00 ERA) will face Tommy Hanson (2-2, 3.38 ERA). ... The Rockies are also off Thursday and start a three-game set against the Mets on Friday. Drew Pomeranz (0-1, 6.75 ERA) will start for Colorado. The Mets had not announced a starter.