The problem is inside 03.01.04.SqlDataProvider there are missing one
"GO" after
CREATE PROCEDURE
{databaseOwner}[{objectQualifier}Store_Orders_UpdateOrderDetails]
so this automatically apply
IF EXISTS (SELECT * FROM {databaseOwner}[sysobjects] WHERE id =
object_id(N'{databaseOwner}[{objectQualifier}Store_Orders_CountCouponUsage]')
and OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE
{databaseOwner}[{objectQualifier}Store_Orders_CountCouponUsage]
GO
and drop the procedure.
Solution:
Go to procedure "Store_Orders_UpdateOrderDetails" in
your database and delete from the bottom of it
IF EXISTS (SELECT * FROM {databaseOwner}[sysobjects] WHERE id =
object_id(N'{databaseOwner}[{objectQualifier}Store_Orders_CountCouponUsage]')
and OBJECTPROPERTY(id, N'IsProcedure') = 1
DROP PROCEDURE
{databaseOwner}[{objectQualifier}Store_Orders_CountCouponUsage]
after that re-create the "Store_Orders_CountCouponUsage"
procedure like below:
CREATE PROCEDURE [dbo].[dnn_Store_Orders_CountCouponUsage]
@PortalID int,
@UserID int,
@CouponID int,
@OrderID int
AS
SET NOCOUNT ON
SELECT COUNT(*) FROM dbo.dnn_Store_Orders o
WHERE o.PortalID = @PortalID AND o.UserID = @UserID AND o.CouponID = @CouponID AND o.OrderID <> @OrderID AND o.OrderIsPlaced = 1