Hi following is my stored procedure.
create procedure driversms
@did = (select distinct driver_id from Busdetails where tour_id=@tid)
select mobile from Drivermaster where driver_id=@did
my requirement is to fetch driver_id from busdetails by passing tour_id as parameter.
and store it in @did.then fetch mobile from drivermaster using @did.
error showing is
Msg 102, Level 15, State 1, Procedure driversms, Line 10
Incorrect syntax near '@did'.
how to solve this