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)试试!
试了 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.
inner join BIProductUrl on BIProductUrl.UrlId=BIReport.UrlId
inner join BIUserControl on BIUserControl.ControlId=BIReport.ControlId where ReportId ='+ltrim(@ReportId)试试!
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.