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.
Author |
Topic |
delbar
Starting Member
5 Posts |
Posted - 2009-11-17 : 04:40:45
|
urgent. How do I all a stored procedure that has a parameter and returns a result set of records from another stored procedure? In this other stored proc I will need to call the parameter in also.thanks,delbar |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-11-17 : 09:04:46
|
[code]Create Proc yourProcASDeclare @param intset @param = 5Exec someOtherProc @param[/code]or[code]Create Proc yourProc @param intASExec someOtherProc @param[/code] |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2009-11-17 : 10:59:03
|
[code]DECLARE @Return varchar(2000)EXEC [dbo].[my_sp] @one,@Return outputSELECT @Return[/code] |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2009-11-17 : 11:08:05
|
NB: dont forget to use the keyword output after the return value |
|
|
delbar
Starting Member
5 Posts |
Posted - 2009-11-17 : 11:58:09
|
thank you all for your contributions - will certainly use them all.... What I have doneout was to create a table variable and a parameter in my sproc.e.g.; Create spGetSPRowset@DateVal as varchar (6)asDeclare @people table (NewPK int identity(1,1), Namechar(3) null,PrimNumber char(6) null,PrimClass char (1) null)insert into @peopleexec dbo.uspGetRows @Rows = @DateValnow I have to do something else with the data - like a few select statements to filter the data. thanks again all for your quick replies!!!! |
|
|
|
|
|