Using dynamic query in SQL Reporting Services 2000

  • I am using dynamic query in SQL Reporting Services. I can view the result in Data View. However, list of fields is not available in Layout view... any ideas???

  • In data view click on the ... next to the Dataset name and on the fields tab add the fields manually. Fields will only be added automatically from non dynamic SQL.

    Facts are stubborn things, but statistics are more pliable - Mark Twain
    Carolyn
    SQLServerSpecialists[/url]

  • Thanks for the reply. Now I am not getting any compile time error. However, its displaying only headings but no records.

    Following is the query:

    Declare @MyNewSql nvarchar(4000)

    Select @MyNewSql = 'Select TaskName FROM TrnTask '

    Select @MyNewSql = @MyNewSql + ' WHERE ' + @Condition

    Execute (@MyNewSql)

    Please advice me.

  • I am confused about the variable @Condition.

    Is it a parameter or variable?

  • I forgot to mention one thing, I am getting following warning:

    The data set ‘TaskList’ contains a definition for the field ‘TaskName’. This field is missing from the returned result set from the data source.

    Preview complete -- 0 errors, 1 warnings

  • @Condition is a parameter

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply