I also found out something new about this. If I change my SET statements to
SELECT statements, it fixes the problem, but a new one pops up. Now, RS
thinks that the variable I am using is the wrong data type. How does RS know
what datatype to make the variable?
> I have a query that I am using in my report as a text dataset (i dont want it
> in a stored proc yet) but my issues is that I have a variable defined that I
[quoted text clipped - 11 lines]
>
> Any ideas why this is happening?
Bruce L-C [MVP] - 31 Oct 2006 19:44 GMT
Go to layout tab, click anywhere so the Report menu shows up. Report
Parameters. Set to the appropriate datatype.
As far as it disapppearing. My guess is because you use set it assumed this
was a local variable, not a parameter (and rightly so).
Note that you can map query parameters to an expression instead of directly
to the parameter. The fact that you used the select maybe caused it to stay
in the parameter list but because you are doing a trim it assumes it is a
text parameter (again guessing).
I suggest you stop trying to actually create your stored procedure logic
this way. Instead, first create and test your stored procedure outside of
the report Or just put in the very minimal amount needed (i.e. no ltrim)
just enough to allow you to get back the right data.
Also, in your stored procedure do the following:
1. leave out set nocount on
2. Let SQL server do the object lifetime management. If you use temp tables
don't explicitly drop them. Let SQL Server handle temp table cleanup. Have
the last statement be a select on your temp table and then exit the stored
proc.

Signature
Bruce Loehle-Conger
MVP SQL Server Reporting Services
>I also found out something new about this. If I change my SET statements to
> SELECT statements, it fixes the problem, but a new one pops up. Now, RS
[quoted text clipped - 22 lines]
>>
>> Any ideas why this is happening?