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)
 Run procedure

Author  Topic 

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2007-03-20 : 06:17:00
Hello,

I have a procedure, named ProcB, with two parameters:
InPar UNIQUEIDENTIFIER
OutPar UNIQUEIDENTIFIER OUTPUT

I want to run this procedure from another procedure ProcA and give get the value of OutPar.

How can I do this?

Thanks,
Miguel

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-20 : 06:22:18
declare @a uniquteidentifier

exec procb newid(), @a out

select @a


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-20 : 06:23:38
[code]create proc procA
as
declare @InPar uniqueidentifier, @OutPar uniqueidentifier

Set @InPar = '' -- set some input value here
exec procB @InPar, @OutPar output
select @OutPar -- display value of o/p parameter
Go[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-20 : 06:27:05
Woohoo! 80 seconds...


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-20 : 06:36:57
Once again out of luck...

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2007-03-20 : 10:42:30
I didn't realized there was a speed competition going on in SQL Server Forums ... :-)

Thank you for both answers!
Miguel
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-20 : 21:38:22
quote:
Originally posted by shapper

I didn't realized there was a speed competition going on in SQL Server Forums ... :-)

Thank you for both answers!
Miguel


Believe me there is. It is always Peter against others. The winner gets nothing. Loser gets a


KH

Go to Top of Page
   

- Advertisement -