SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO




 


ALTER  PROCEDURE dbo.bvc_Orders_ByCoupon_s

@CouponCode nvarchar(50)

AS

	SELECT [ID],GrandTotal,TimeOfOrder,UserName,UserID,CompletedOrderID
	FROM bvc_Order o LEFT OUTER JOIN bvc_OrderCoupon oc ON o.id=oc.OrderID
	WHERE CouponCode=@CouponCode AND StatusCode=3
	ORDER BY [ID] DESC
	
	RETURN
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

