SQL Server 2005
Hi
Please help me with this. I developed a report based on a SP, with subreports and it's running very slow. The subreports are each based on a SP as well.
How do I combine in a single SP several SPs with different selects?
For example
Report:
SELECT no, sales, … FROM table WHERE (table.Date >= @DateStart AND table.Date<@DateEnd)
Subreport1:
SELECT no, sales, …. FROM table WHERE table.comp=’A’ AND table.type=’Imp’ AND (table.Date >= @DateStart AND table.Date<@DateEnd)
Subreport2:
SELECT no, sales, … FROM table WHERE table.comp=’A’ AND table.type=’Imp’ AND table.via=’Air’ AND (table.Date >= @DateStart AND table.Date<@DateEnd)
……
Hi
Please help me with this. I developed a report based on a SP, with subreports and it's running very slow. The subreports are each based on a SP as well.
How do I combine in a single SP several SPs with different selects?
For example
Report:
SELECT no, sales, … FROM table WHERE (table.Date >= @DateStart AND table.Date<@DateEnd)
Subreport1:
SELECT no, sales, …. FROM table WHERE table.comp=’A’ AND table.type=’Imp’ AND (table.Date >= @DateStart AND table.Date<@DateEnd)
Subreport2:
SELECT no, sales, … FROM table WHERE table.comp=’A’ AND table.type=’Imp’ AND table.via=’Air’ AND (table.Date >= @DateStart AND table.Date<@DateEnd)
……