OPINION OF THE COURT
Boomer, J.Defendant appeals from a judgment entered upon a plea of guilty convicting him of conspiracy in the second degree. His principal argument is that his plea should have been set aside because he had been granted transactional immunity.
Defendant was arrested for selling 500 grams of cocaine to an undercover police officer. Immediately after his arrest he gave the officer information about the source of the drugs. Based on this information the officer applied by telephone for a warrant to search a certain motel room for cocaine. The Judge to whom the application was made asked to speak to the informant, and defendant was sworn and told the Judge how he knew that cocaine would be found in the motel room. In the course of the telephone conference, the District Attorney told defendant that anything he related to the Judge concerning his purpose in being in the motel room would not be used against him in any court of law. The Judge then told defendant that the District Attorney had indicated that there would be no prosecution against him as the result of testimony concerning his purpose in being in the motel room.
After being charged with criminal possession of a controlled substance in the first degree, a class A felony, defendant entered into a written plea agreement whereby the prosecution, in return for defendant’s cooperation in disclosing information about illegal drug traffic, agreed to accept defendant’s plea to the class B felony of conspiracy in the second degree in full satisfaction of the charges against him.
After pleading guilty to the charge of conspiracy in the second degree and before sentencing, defendant moved to vacate his plea on the ground that he had been granted transactional immunity by reason of the testimony he had *271given in support of the application for the search warrant. The court denied his motion and defendant appeals from the judgment of conviction.
We agree with the sentencing court that defendant was not granted transactional immunity. CPL 50.20 provides a multistep procedure for granting judicial immunity in proceedings other than a Grand Jury proceeding. As stated in Matter of Brockway v Monroe (59 NY2d 179, 187), immunity is granted when "the witness invokes his right not to give evidence on the ground that it may incriminate him; the prosecutor requests the court to grant immunity to the witness; the court orders the witness to give the requested evidence notwithstanding his assertion of his privilege against self incrimination and advises him that he will receive immunity on doing so; and the witness complies with the order by giving the requested evidence”. Complete immunity from prosecution may be granted only by strict compliance with the procedural requirements of the immunity statutes (People v Laino, 10 NY2d 161, 173, cert denied 374 US 104).
Here, there was no grant of immunity because the procedures set forth in CPL 50.20 were not followed. Subdivision (4) of CPL 50.20 expressly provides that if a witness gives evidence without asserting his privilege against self-incrimination, he does not receive immunity. Subdivision (2) (b) (i) provides that the Judge must order the witness to give the requested evidence, notwithstanding his assertion of the privilege. Defendant did not assert his privilege against self-incrimination and the Judge did not order him to testify.
Insofar as defendant, in giving his testimony, relied on the promise of the prosecutor not to use this testimony against him in a court of law and on the promise of the court that he would not be prosecuted as a result of the testimony he gave concerning his purpose in being in the motel room, defendant was entitled to an order suppressing such testimony should the prosecutor seek to use it against him. In that sense, defendant was granted use, and not transactional immunity (see, People v Laino, supra, at 172).
Defendant’s reliance on Matter of Brockway v Monroe (supra) for his contention that strict adherence to statutory procedures is not essential to a grant of transactional immunity is misplaced as applied to the facts of this case. In Brockway the court, the prosecutor, and the defendant all agreed that it would not be necessary for the defendant to *272assert his privilege to each and every question and the Court of Appeals permitted deviation from the statute to that extent. Here, however, not only was there no express agreement to deviate from the statutory procedure, but there was more than the minor deviation in Brockway; there was a complete failure to comply with any of the statutory provisions. A holding that transactional immunity may be granted under the circumstances of this case would frustrate the purpose of the Legislature in enacting CPL 50.20, which was to avoid conferring overly broad and unnecessary grants of immunity (see, Matter of Brockway v Monroe, supra, at 187-188).
Defendant further argues that his sentence of an indeterminate term of 8Vá to 25 years is harsh and excessive. Considering the amount of illegal drugs involved, defendant’s past participation in drug sales, and the enterprise for the distribution of illegal drugs that he planned to establish, I find the sentence appropriate. Accordingly, the judgment of conviction should be affirmed.