For years now, Republicans in Congress have blithely voted against bills to raise the national debt ceiling, knowing full well that the Democrats would step forward and take the heat to keep the government solvent, even at the price of being labeled big spenders.

So it is not surprising that Republicans this week are squirming and Democrats savoring the sweet irony: Here is Ronald Reagan, Republican president and fiscal conservative par excellence, having to ask Congress to let him expand the national debt to nearly a trillion dollars.

"Unappetizing," was the way David A. Stockman, director of the Office of Management and Budget, put it this week. He told the House Ways and Means Committee, "There is no choice but to increase the national debt limit if we are to honor the commitments already made by the government . . . the bills are coming due and they must be paid."

Democrats on the panel were quick to point out that, during his six years in Congress, Stockman always voted against increasing the debt ceiling. Stockman confessed, "I'm not particularly delighted to have to appear on this topic."

But if the president's representative was uncomfortable, imagine the plight of House Republicans who have built their political reputations on indignation over the bloated national debt. They used the issue in labeling Democratic opponents "fiscally irresponsible." They used it to coax money from wealthy conservative groups for whom debt-ceiling votes are litmus tests of ideological purity.

Now that the tables are turned, and the Republicans must choose between loyalty to a conservative president and loyalty to "fiscal conservatism," they feel rather awkward. "I suppose we must gird our loins," said Millicent Fenwich (R-N.J.). "I'm in a very difficult period. For the moment I'm keeping my powder dry and my mouth shut. I won't say I won't, but I won't say I will."

As for House Democrats, the official line is "cooperation." In a news conference, Huse Speaker Thomas P. (Tip) O'Neill Jr. said he is counting on 100 Republicans and a majority of Democrats to vote for the increase. The Democrats should "not be obstructionists," he said.

Nonetheless, there is some talk of revenge. "A lot of Democrats have been savaged on this issue over the years, and they'd like to let the Republicans twist slowly in the wind," said one high-level Democratic staffer.

Marty Russo, a Chicago Democrat on the Ways and Means Committee, says there's a "good possibility" he will vote against the debt-ceiling increase.

Sen. Ernest Hollings (D-S.C.) bitterly recalls that North Carolina Republican Sens. Jesse Helms and John P. East ran campaign ads using a debt-ceiling vote to defeat former senator Robert Morgan (D-N.C.). Now that the Republicans want to raise the debt ceiling, "I'll withhold my vote until Jesse Helms votes for it," Hollings said. "Let the Republicans take the responsibility for what they call 'irresponsible.'"

Barber B. Conable Jr. of New York, ranking Republican on Ways and Means, sniffs at talk of Democratic retaliation. "Some of the Democrats want to tut-tut like a bunch of old hens," he said. "But it's just fun and games. It's an opportunity for entertainment that's likely to turn sour."

House Minority Leader Robert H. Michel of Illinois is trying hard to round up this troops, but he is none too sure that he can muster a majority for the debt-ceiling vote tomorrow -- at least the first time. The Republican whip's count in the House last week showed only about 80 yes votes, many of them tentative.