Ok, this is my issue:
We have a stored procedure with an amazing amount of records (1 million). The only data returned is constrained based on the 'Where' clause where a record had a field = ID (which is chosen by the user in the form of a stored procedure parameter).
In the report header, I want to show - NOT the specific ID chosen - but the description of the ID (which stems from a table made up of the ID and the description).
In a textbook scenario, I know I should set the parameter up to find records where the id = parameter value (this would be more efficient than having the parameter = the description, which is not indexed), but in order to display the ID DESCRIPTION, the only way I can think of accomplishing my task, is to return the description with EVERY record by adding it to the 'Select' clause, which just seems like a waste to me.
Is there a way to set up a variable in the stored procedure so that
v = id.description
where id.id = p_id
and then pass the variable (v) to CR so that instead of returning id.description 1,000,000 times, I only return it once???
Please help!!
Thanks!
Kelly
kelly.steensma@us.pwcglobal.com
We have a stored procedure with an amazing amount of records (1 million). The only data returned is constrained based on the 'Where' clause where a record had a field = ID (which is chosen by the user in the form of a stored procedure parameter).
In the report header, I want to show - NOT the specific ID chosen - but the description of the ID (which stems from a table made up of the ID and the description).
In a textbook scenario, I know I should set the parameter up to find records where the id = parameter value (this would be more efficient than having the parameter = the description, which is not indexed), but in order to display the ID DESCRIPTION, the only way I can think of accomplishing my task, is to return the description with EVERY record by adding it to the 'Select' clause, which just seems like a waste to me.
Is there a way to set up a variable in the stored procedure so that
v = id.description
where id.id = p_id
and then pass the variable (v) to CR so that instead of returning id.description 1,000,000 times, I only return it once???
Please help!!
Thanks!
Kelly
kelly.steensma@us.pwcglobal.com