Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Passing 2 parameters through Cmd Type TEXT

Author  Topic 

5fifty5
Starting Member

35 Posts

Posted - 2008-02-13 : 10:19:52
Hi,

I have created a report in VS 2003 using command type as Text for a stored procedure. The stored procedure itself takes in 2 parameters.

I have passed one of them in the exec statement but the other parameter is the one which I want to pass to the stored procedure through report.

So, in short, I have got this statement in dataset



EXEC SP1 1


The stored procedure itself takes in 2 parameters. One parameter is for if conditions which I have used inside the SP, based on which respective conditions are executed. The other parameter is a sort of global/report parameter which all other datasets are using in order to produce the report with whatever the second parameter is



e.g. the procedure itself is



create sp

@dataset int

@c_area char(2)

AS



the statement in VS where I've set the command type to text is as follows:



exec SP 1



1 here is for dataset variable. Now I want to pass on the value for c_area through same statement. I cant use command type as stored procedure because that would ask for a value, which I dont want.


Cheers.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-02-13 : 10:29:37
exec SP 1, 'fg'



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

5fifty5
Starting Member

35 Posts

Posted - 2008-02-13 : 10:55:24
Yeah I know how to do it that way.

The thing is that the other parameter is a global/report parameter which is being passed to a number of other SP's as well, which I cannot put in here. In other words its not a constant value. It keeps on changing.
So what I want to know is as to how can I pass that report parameter which is itself being returned by a SP. I have defined it in the report parameters, but I dont know what to do it when I have to pass it to a stored procedure which has 2 parameters and command type TEXT.

I hope you understand what I am trying to say.
Go to Top of Page
   

- Advertisement -