本帖最后由 wangdingbang 于 2011-08-04 15:24:47 编辑

解决方案 »

  1.   

    set @str ='Select * From BIReport inner join BIProduct on BIProduct.ProductId=BIReport.ProductId
                inner join BIProductUrl on BIProductUrl.UrlId=BIReport.UrlId
                inner join BIUserControl on BIUserControl.ControlId=BIReport.ControlId where ReportId ='+ltrim(@ReportId)试试!
      

  2.   

    试了
    The name 'Select * From BIReport inner join BIProduct on BIProduct.ProductId=BIReport.ProductId
    inner join BIProductUrl on BIProductUrl.UrlId=BIReport.UrlId
    inner join BIUserControl on BIUserControl.ControlId=BIReport.ControlId 
    where ReportId =17' is not a valid identifier.
      

  3.   

    EXECUTE   @strexec(@sql)括号看看!