Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

ssrs error variable name '@pCNum' has already been declared. variable names must be unique within a query batch or stored procedure. " Expand / Collapse
Author
Message
Posted Saturday, August 9, 2014 5:18 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, September 25, 2014 11:17 AM
Points: 377, Visits: 446
In an existing SSRS 2008 report, I am getting the following error message when I run the ssrs report:
"query execution failed for dataset 'getMilestones'. The variable name '@pCNum' has already been declared. variable names must be unique within a query batch or stored procedure. "
The parameter called 'pCNum' is the only paramter by that name that I can see. This is a cascading paramter. There are at least 2 parameters that reference 'pCustomerNumber'. Thus I am not certain what could be wrong. Could the order of how the parameters str declared make a difference?

Would you let me know what you think is wrong so that I could try to resolve this issue?
Post #1601501
Posted Saturday, August 9, 2014 5:46 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 4:56 AM
Points: 20,815, Visits: 32,748
Not enough info to really help. Unfortunately we can't see what you see. May help if you post the procedure that is being run for this report.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1601516
Posted Monday, August 11, 2014 3:23 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 5:39 AM
Points: 2,078, Visits: 3,610
Are you declaring @pCNum in the dataset code?

In SSRS you don't declare the parameter in code. That's how BIDS determines it's a report parameter.
Post #1601727
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse