Home > Archive > MS SQL Server > April 2006 > Multiple recordsets returned ..from one stored procedure ....









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Multiple recordsets returned ..from one stored procedure ....
busyboy

2006-04-01, 3:23 am

i have a stored procedure like this ...


create proc mystoredproc
as begin


create table #temp1 (field1 numberic)


insert into #temp1
select * from sometable


if ( select count(*) from temp1 ) <= 20000 )
begin

select 1
end
else

begin
select 0
end

end


this return two sets of records?

the 1st select statement and the last select statement also ....


I want only the last select statement to return records ...

How can I achive this ?


busyboy

oj

2006-04-01, 3:23 am

create proc mystoredproc
as
set nocount on
begin
create table #temp1 (field1 numberic)
insert into #temp1
select * from sometable
if ( select count(*) from temp1 ) <= 20000 )
begin
select 1
end
else
begin
select 0
end
end
go



--
-oj



"busyboy" <rajanmisra@gmail.com> wrote in message
news:1143865304.328058.182550@z34g2000cwc.googlegroups.com...
>i have a stored procedure like this ...
>
>
> create proc mystoredproc
> as begin
>
>
> create table #temp1 (field1 numberic)
>
>
> insert into #temp1
> select * from sometable
>
>
> if ( select count(*) from temp1 ) <= 20000 )
> begin
>
> select 1
> end
> else
>
> begin
> select 0
> end
>
> end
>
>
> this return two sets of records?
>
> the 1st select statement and the last select statement also ....
>
>
> I want only the last select statement to return records ...
>
> How can I achive this ?
>
>
> busyboy
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com