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