Report has no parameters and arguments were supplied

  • Hi Experts,
    Please help me with the below query.I am not sure where i am getting it wrong.When i execute the proc it gives me an error "dbo.p_Detail_Report has no parameters and arguments were supplied"

    Create Procedure dbo.p_Detail_Report
    AS

      DECLARE @email varchar(255), @Username nvarchar(320),@userid bigint,@startdateincl date,@Enddateincl date;
      DECLARE @startdatetime datetime2(7),@Enddatetime datetime2(7);
         
        IF @startdateincl >@Enddateincl RETURN;
          SELECT @startdatetime = @startdatetime,@Enddatetime= DATEADD(dd,1,@Enddateincl)
     
    SELECT 
       iw.UserId,
             dc.UniqueId,
             dc.UsAccountNo,
      convert(date,iw.date) as date,
             dv.VendorName as Vendor,
             dg.Game_Name as Game,
             dc.Currency_Code as Currency,
           iw.Amount,
             iw.BalanceBefore as Before,
           iw.BalanceAfter as After,
           iw.BonusAmount as Bonus,
           iw.lockedamount as Locked
         FROM PL.Staging.dbo_Wager AS iw WITH (NOLOCK)
         JOIN
         DB.Vt_DW.dbo.Dim_Game AS dg WITH (NOLOCK)
         ON iw.GameId = dg.Game_Id
         JOIN
         DB.Vt_DW.dbo.Dim_Vendor AS dv WITH (NOLOCK)
         ON iw.vendorId = dv.VendorId
         JOIN DB.Vt_DW.dbo.Dim_Player As dc WITH (NOLOCK)
         ON iw.userid = dc.Userid
         AND dc.GamingServerId    =1001
         Where (dc.UniqueId = @email
             OR dc.UsAccountNo = @Username
             OR dc.Userid = @userid)
         AND iw.date >=@startdatetime
         AND iw.date <@Enddatetime
         GO

    Exec dbo.p_Detail_Report @email='megan@gmail.com',@Username='MGN',@userid='0',@startdateincl ='2017-07-06',@Enddateincl='2018-08-20'

    Many thanks

    S.

  • The error message is clear. Your proc has no parameters.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • You haven't set up your procedure to take parameters, but you've tried to pass in parameters.  From your procedure, it looks like you want to change it so that it does take parameters.  Just change the beginning to

    Create Procedure dbo.p_Detail_Report (@email varchar(255), @Username nvarchar(320),@userid bigint,@startdateincl date,@Enddateincl date)
    AS
      DECLARE @startdatetime datetime2(7),@Enddatetime datetime2(7);

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply