SQL Server Performance

problem with parameters

Discussion in 'SQL Server Reporting Services' started by lenka77, May 9, 2004.

  1. lenka77 New Member

    Hi all,
    I hope someone can help me.. I can't seem to get the parameters working at all. I have a dynamic quiery (="select * from employee where job_id=" & Parameters!jobid.Value) in my report, and a parameter jobid.. I link to this report from another one, passing the parameter in the URL, but it displays all rows! I can't figure out what i am doing wrong.. I changed the query to "select * from employee where job_id=3", and then it displayed just one row (which is correct). Then I changed it back to
    (="select * from employee where job_id=" & Parameters!jobid.Value) and it worked correctly if the value of the parameter is 3, but in all other cases it gave me the error that the value of the parameter passed is invalid..

    anyone else experienced smth similar? is there something wrong with my configurations?

    thanks in advance..
  2. harsh_sr New Member

    A good way to have a Paramterise query is:
    SELECT * FROM employees
    WHERE job_id = @job_id

    In this case, report manager automatically creates parameter & displays it in your report.

    HTH
    Harsh
  3. lenka77 New Member

    thank you so much! It worked!

Share This Page