Monday, February 20, 2012

Multiple resultSet from SPs

Hi,
Question regarding displaying data on Datagrid. it works fine
I have 4 SP's the results of which I feel are too much overhead. so I put
all the 4 queries into as single STP and it runs successfully but only the
first one is bound for eg:
Create PROCEDURE dbo.Sample
(
@.id int,
}
as
Select * from Sample1 where id = @.id
Select * from Sample2 where id = @.id
GO
why does it not append/display the entire resultset?
Thanks,
Stephen
[P.S: Read a Post that "SPs Operate on a single rowset from each query"
Is it True?]RS (both RS 2000 and RS 2005) only support a single resultset. You can't do
what you want to do.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Stephen" <stephen_jn@.hotmail.com> wrote in message
news:uZy9Ky%234FHA.1864@.TK2MSFTNGP12.phx.gbl...
> Hi,
> Question regarding displaying data on Datagrid. it works fine
> I have 4 SP's the results of which I feel are too much overhead. so I put
> all the 4 queries into as single STP and it runs successfully but only the
> first one is bound for eg:
> Create PROCEDURE dbo.Sample
> (
> @.id int,
> }
> as
> Select * from Sample1 where id = @.id
> Select * from Sample2 where id = @.id
> GO
> why does it not append/display the entire resultset?
> Thanks,
> Stephen
> [P.S: Read a Post that "SPs Operate on a single rowset from each query"
> Is it True?]
>|||If the column data types and number of columns are the same you can use a
union to construct a single result set ie
select * from a
UNION ALL
Select * from b
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"Stephen" wrote:
> Hi,
> Question regarding displaying data on Datagrid. it works fine
> I have 4 SP's the results of which I feel are too much overhead. so I put
> all the 4 queries into as single STP and it runs successfully but only the
> first one is bound for eg:
> Create PROCEDURE dbo.Sample
> (
> @.id int,
> }
> as
> Select * from Sample1 where id = @.id
> Select * from Sample2 where id = @.id
> GO
> why does it not append/display the entire resultset?
> Thanks,
> Stephen
> [P.S: Read a Post that "SPs Operate on a single rowset from each query"
> Is it True?]
>
>|||Hi Bruce and Wayne
Thanks for the info.
Stephen
"Stephen" <stephen_jn@.hotmail.com> wrote in message
news:uZy9Ky%234FHA.1864@.TK2MSFTNGP12.phx.gbl...
> Hi,
> Question regarding displaying data on Datagrid. it works fine
> I have 4 SP's the results of which I feel are too much overhead. so I put
> all the 4 queries into as single STP and it runs successfully but only the
> first one is bound for eg:
> Create PROCEDURE dbo.Sample
> (
> @.id int,
> }
> as
> Select * from Sample1 where id = @.id
> Select * from Sample2 where id = @.id
> GO
> why does it not append/display the entire resultset?
> Thanks,
> Stephen
> [P.S: Read a Post that "SPs Operate on a single rowset from each query"
> Is it True?]
>

No comments:

Post a Comment