I am performing a SP to perform a specific search with parameters, but it brings me the following error. How to solve it?
Msg 137, Level 15, State 2, Procedure spPantallaTasa, Line 6 Must declare the scalar variable "@insurer".
Msg 137, Level 15, State 2, Procedure spPantallaTasa, Line 10 Must declare the scalar variable "@insurer".
SQL:
CREATE PROC spPantallaTasa
@asegradora VARCHAR(20)
AS
IF (@aseguradora = 'Caracas')
BEGIN
Select Año, TipoCotizacion, Estatus, TipoVehiculo, SubTipoVehiculo, ClaseCompañia, Zona
FROM [dbo].[RelacionClaseTasa], [dbo].[MPF_Tasas]
WHERE Aseguradora = @aseguradora
END
ELSE
BEGIN
SELECT 1
END
The variable names are not the same... in the job parameter you missed the U: @asegRadora and @aseguradora
The problem is that the variable you declared is called @asegradora and below you call it @aseguradora instead of @asegradora. Cheers