Código SQL:
Ver originalCREATE PROCEDURE [dbo].[Produccion_1]
AS
DECLARE @tmpType VARCHAR(15), @Trans_type VARCHAR(30)
BEGIN
IF(@Trans_type = 'subscr_signup')
BEGIN
SET @tmpType = 'premium'
END
ELSE
BEGIN
IF (@Trans_type = 'subscr_cancel')
BEGIN
SET @tmpType = 'basic'
END
END
INSERT INTO ENSABLAJE_BASICO
SELECT * FROM PRODUCCION WHERE TIPO_MAQ = @tmpType
END
P.D: El plz plz plz esta de mas ¬¬