Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/02/2013, 11:37
ragde23fer
 
Fecha de Ingreso: octubre-2008
Mensajes: 268
Antigüedad: 15 años, 7 meses
Puntos: 3
Respuesta: Error Variables en Store Procedure

Ah por cierto, el error me sale en la linea "10", "12", "14"

IF(@Trans_type = 'subscr_signup')
BEGIN
@tmpType = 'premium' END
ELSE(@Trans_type = 'subscr_cancel')
BEGIN
@tmpType = 'basic'
END

Cita:
Iniciado por ragde23fer Ver Mensaje
Hola a todos, tengo un error al querer crear un store procedure con variables que declaro internamente, mas no hacia afuera, alguien podria ayudarme? este es el script:

Código:
CREATE PROCEDURE [dbo].[Produccion_1]
AS
DECLARE @tmpType VARCHAR(15), @Trans_type VARCHAR(30)


BEGIN

IF(@Trans_type = 'subscr_signup')
    BEGIN
    @tmpType = 'premium'
    END
ELSE(@Trans_type = 'subscr_cancel')
    BEGIN
    @tmpType = 'basic'
    END
INSERT INTO ENSABLAJE_BASICO
SELECT * FROM PRODUCCION WHERE TIPO_MAQ = @tmpType
END