Disadvantages with Store Procedure [closed]

1

I'm doing an 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 "@aseguradora".

     

Msg 137, Level 15, State 2, Procedure spPantallaTasa, Line 10   Must declare the scalar variable "@aseguradora".

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
    
asked by Hans 20.10.2016 в 17:08
source

2 answers

3

The names of the variable are not the same ... in the job parameter you missed the U: @asegRadora and @aseguradora

    
answered by 20.10.2016 / 17:16
source
0

The problem is that the variable you declared is called @asegradora and below you call it @aseguradora instead of @asegradora. Greetings

    
answered by 20.10.2016 в 17:22