Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Parameter value coverts to INT from VARCHAR within Define Query Parameter window used in Proc within Query Designer - SSRS 2008

$
0
0

I'm having an issue with SSRS 2008.

 I have a stored procedure that has a parameter set up into it. So when ever I run the stored procedure in the Query Designer within SSRS, a Define Query Parameter window pops up asking to input the parameter value. As I enter the value (value is set as varchar), SSRS gets confuses and thinks it is an integer; therefore, it converts the number who has leading 0s in front of it to an integer and removes the leading 0s. Is there a way to go around this?

Here is my proc I used in the report:

CREATE

PROCEDURE [dbo].[REPORT](IDASVARCHAR(100))

AS

 

DECLARE @ReportASVARCHAR(8000

)

DECLARE

@Date ASVARCHAR(100)=CONVERT(VARCHAR(50),GETDATE(),112

)

SELECT

@Report ='SELECT *FROM DatabaseName.dbo.Table_'+ @ID +'_'+ @Date+'_OUTPUT' 

EXEC

(@Report

)

 I then Input the report proc name into the Query Designer Window within SSRS. So, when the query design window is being run, it prompts for the @ID parameter which is a define as a VARCHAR in proc, but when I enter the paramater value = 0123. It displays back   these:

Error occur while executing query: Invalid name : DatabaseName.dbo.Table_123_20111108_OUTPUT (notice that the "0" has been removed in front of the 123 within the table name.

Is there a way to pass by this error in SSRS. To have it know it's a varchar field not a INT field? HELP!!!! Has anyone else experience this issue????


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>