Parameter Query with inLogin on SQL Server 2008 R2

(3 posts) (2 voices)
  1. chiacy, Member

    I have the following parameter query to restrict pop-up choices based on user's group, thus I need inLogin to pass on to a stored procedure as follow:

    create sp_dbr_list_of_choices @inLogin varchar(30) as begin

    select choices from dbo.colors where username=@inLogin

    end

    in Parameter query, I set up as
    exec sp_dbr_list_of_choices

    SQL server returned with error when I run the report with this parameter query attached as parameter, as follow

    DB error: Procedure or function 'sp_dbr_list_of_choices' expects parameter '@inLogin', which was not supplied. SQL: exec sp_dbr_list_of_choices

    Please advise

  2. myDBR Team, Key Master

    The parameter query contains just the query, nothing else. Remove the "exec " from the parameter query and you should be fine.

    --
    myDBR Team

  3. chiacy, Member

    Yes!!!! It works!!


Reply

You must log in to post.