i have an SP that executes 1 SP at the moment
EXEC mpSPAccess.PostIdSelect @PostDate = @TodaysDate
The SP does something like this (very simplyfied :))
SELECT id FROM Post WHERE DateCreated = @PostDate
After this SP is Executed i want to use the id i got from PostIdSelect as an parameter for more SPs Like this:
EXEC mpSPAccess.GetSomethingWithThePostIdSelect @PostId = @PostIdFromTheFirstSpSELECT
EXEC mpSPAccess.GetAnotherSomethingWithThePostIdSelect @PostId = @PostIdFromTheFirstSpSELECT
Is this possible in some way?
You could just set up your PostIdSelect stored proc to return an int or whatever appropriate output parameter representing the ID you select, then feed that to your other procs, something like:
Then to utilize this,
One note, with your initial SELECT statement, you probably want to use SELECT TOP 1 ID or something to prevent multiple values from being returned, unless you know for certain that DateCreated will be unique to every single record in the table.