Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 can i use 2sprocs in one?

Author  Topic 

ri16
Yak Posting Veteran

64 Posts

Posted - 2008-02-05 : 11:46:15
i have 2store procedures
p_code1
p_code2

i have to use this both sproc in main sproc p_code

so when i m using like:

create proc p_code
as
begin
exec p_code1
exec p_code2
end
go

it doesn't give me error but not giving me correct results from both sproc...when i m executing both sproc individually it gives me correct result..i have to use both sprocs results in only one execution...so i need to create third - main sproc in which i can call 2sprocs..but not giving me correct rows results...

can anyone guide me on this?

thanks for ur help.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-05 : 11:48:52
why do you say its not giving correct results? what's your expected result? can you explain with some sample data?
Go to Top of Page

ri16
Yak Posting Veteran

64 Posts

Posted - 2008-02-05 : 12:36:21
quote:
Originally posted by visakh16

why do you say its not giving correct results? what's your expected result? can you explain with some sample data?



hi,

when i am executing only exec p_code
it says - procedure successfully completed.
returns no rows.

i have to pass input parameter in both p_code1 and p_code2 while executing them...so when i am declareing this parameter with this main sproc..

declare @inputp int
exec p_code 0

Procedure p_code has no parameters and arguments were supplied

so can u tell me what is the reason?

Thanks for ur help.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-05 : 12:38:50
it says p_code sp has no parameters defined. Then why are you passing 0?
Go to Top of Page
   

- Advertisement -