I had this problem with my 99 Maxima a few weeks ago, did quite a bit
of research online about it, including numerous newsgroups and ended up
fixing it by doing the following:
The light came on just a few minutes after I had filled up on gas, so I
drove the car with the light on until it was pretty much empty again,
then went and bought some good fuel injector cleaner, filled it up with
a full tank of the best gas I could find (93 octane) and dumped the
fuel injector cleaner in it.
Drove the car for about half a tank and the service engine soon light
turned off and hasn't been back on since.
May or may not work for you, depending on what the actual problem is,
but worked for me and avoided the hastle of checking engine codes or
paying $$$$$ at the dealership. Worth a shot anyway, even if it
doesn't fix your problem, it definitely won't hurt your car and might
save you some dough.