SQLTeam.com | Weblogs | Forums

How to add parameter to this quesry


#1

How do I add parameters to this query? My SP requires them but I can not figure out how to get it to work.

Thanks

SELECT * INTO #tmptbl

FROM OPENROWSET ('SQLOLEDB','Server=(local);TRUSTED_CONNECTION=YES;' 

,'set fmtonly off exec DB.dbo.Rpt_PrintSp')

SELECT * from #tmptbl
drop table #tmptbl


#2

add parameter to the OPENROWSET statement ? You will need to use Dynamic SQL to do that


#3

You should go to this here you can see that how can you pass the parameters to the query. http://arcanecode.com/2010/07/13/adding-query-parameters-to-sql-server-2008-reporting-services-reports/