The Senate approved the most sweeping trade legislation in more than a decade last night by an overwhelming 71-to-27 vote, as 19 Republicans defied a last-minute White House appeal that they oppose the measure.

The measure drew the solid support of Senate Democrats as the 27 negative votes were all cast by Republicans. The majority was large enough to override any veto, as was the House vote in April on a different version of a trade bill. Some Senate Republicans, though, said they voted in favor of the trade bill in hopes it would be changed in conference.

The measure is aimed at what Senate Majority Leader Robert C. Byrd (D-W.Va.) called President Reagan's six years of neglecting record trade deficits, which approached $170 billion last year.

The legislation would force the president to retaliate against other countries' unfair trade practices; make it harder for him to avoid granting trade relief to industries hurt by a fairly traded flood of imports; give the government authority to negotiate in a new round of global talks to strengthen the compact that regulates world trade, and slap a two- to five-year ban on U.S. sales of Toshiba Corp. as punishment for selling high technology milling machinery to the Soviet Union.

The White House objections, delivered personally to the GOP members of the Senate at lunch yesterday by Treasury Secretary James A. Baker III and U.S. Trade Representative Clayton K. Yeutter, were aimed at giving the administration more leverage in getting an acceptable bill from the House-Senate conference that will carve the final measure from the bills passed by the two houses of Congress, administration officials and Senate Republicans said.

They emphasized that President Reagan still wants a trade bill, and Yeutter denied the administration is following a veto strategy.

Nonetheless, Reagan told the Republican congressional leaders at breakfast yesterday that "it will be up to the Democratic leadership as to whether or not Congress sends me a bill that I must veto or puts together something we can accept.

"So far," White House spokesman Marlin Fitzwater quoted the president as continuing, "the signs point straight to a veto on this bill."

After the vote, Reagan reiterated his view that both House and Senate bills are "unacceptable" and leave him "no choice except to veto" them. He added that he remains "willing to work with Congress on a more acceptable bill and will reserve final judgment until action is completed on the trade legislation.

"But any bill that raised the cost of living for American families and reduces the ability of American businesses to compete in the world economy goes exactly in the wrong direction," the president concluded. After the morning meetings with the president and his aides, however, Senate Minority Leader Robert J. Dole (R-Kan.) urged his fellow Republicans to vote no and said, "The White House wants a strong no vote to indicate there are changes the {the Democrats} can do in conference to make it acceptable."

Byrd, who made trade legislation a top priority, differed with Dole. "The way to strengthen the hands of the Senate conferees is to get a solid vote in support of this bill," he said.

And Finance Committee Chairman Lloyd Bentsen (D-Tex.) accused Yeutter of "playing a very dangerous game" that could tear apart a bipartisan coalition that already has eliminated many items that the administration considered objectionable.

He called the administration strategy "a major tactical mistake" because the White house "tried to make a partisan issue out of it at the last minute." He said the White House move drew the votes of a few wavering Democrats while getting fewer Republican votes than some GOP members thought.

Sen. Bob Packwood (R-Ore.), ranking minority member of the Finance Committee, supported the trade bill because he said the Senate corrected most of the objections he had before the debate began. Packwood, who steered the tax overhaul measure through the Senate last year, predicted the conference will draft "a good bill that the president will sign."

Yeutter and Baker told the GOP senators the administration could live with those trade-related portions of the bill that came out of the Finance Committee, especially since the Senate modified its most objectionable parts. They reserved most of the objections, however, for items approved by eight other committees that contributed to the 1,000-page Senate bill.

These included: a requirement that businesses give notices of plant closings, a major objective of organized labor that is strongly opposed by business even after it was watered down considerably; $7 billion in new spending for education, farm export enhancement programs and aid to workers who lose their jobs because of imports; orders to the U.S. representatives to the World Bank and other multilateral lending institutions to withhold funds for projects that subsidize foreign farm and mineral production in areas where there is a world surplus, and requirements that the Treasury secretary seek negotiations for an international debt facility to help ease the Third World debt crisis.

In addition, the administration listed several industry-specific items in the bill, including quotas on lamb imports, a $264 million tariff rebate to a few major sugar refiners and a requirement that the president enforce reciprocity in telecommunications trade.

"The administration has piled everything they have ever taken exception to in a laundry list of objections to increase its bargaining power," said Sen. John C. Danforth (R-Mo.), who worked closely with Bentsen to push the legislation through the Senate.

He said, however, that he was casting a "yes, but" vote to give the conference a chance to retain the good provisions of both House and Senate bills, but to get rid of the bad ones. If the conference fails to accomplish this aim, he added, "I, too, will walk away from the conference table."