CREATE PROCEDURE dbo.usp_booking_insert
@user_id int,
@journey_place varchar(50),
@pickup_address varchar(250),
@return_address varchar(250),
@service_id int,
@vehicle_id int,
@mode_of_payment varchar(50),
@status varchar(5),
@starting_km decimal(15,4),
@ending_km decimal(15,4),
@booking_date datetime
AS
Begin
Declare @uid int
if(@uid = 0)
Begin
set uid = (select max(user_id) from registration)
End
Else
Begin
set uid = @user_id
End
insert into booking (user_id,journey_place,pickup_date,pickup_address,return_date,return_address,service_id,vehicle_id,mode_of_payment,status,starting_km,ending_km,booking_date)
values (@uid,@journey_place,getdate(),@pickup_address,getdate(),@return_address,@service_id,@vehicle_id,@mode_of_payment,'true',0,0,@booking_date)
End
there is an error in dis store procedure of "incorrect syntax near '='"