I have a stored procedure that executes a query, I want to pass the results to another stored procedure, not quite sure how to do that, i tried setting @results to the select query and the executing it, but when i put @results in for the email protion it returned the whole select statement. I might have a bunch of reults from the select and I want to pass it multiple times to the stored procedure, not quite sure how to go about that? Should I create an array or table, and run the stored procedure for every record until end of file? Just some direction woudl help, thanks in advance!
CREATE PROCEDURE sp_remindertest
AS
declare @results as char(50)
select email as found from remindertest where disp = 1 and current_timestamp >=schedtime
exec PKEmail 'someone@email.com','queryresults','Reminder','This is the reminder program reminding you that the reminder program is working!'
GO
Software Engineer
Team Lead
damn bill gates, he has everything
CREATE PROCEDURE sp_remindertest
AS
declare @results as char(50)
select email as found from remindertest where disp = 1 and current_timestamp >=schedtime
exec PKEmail 'someone@email.com','queryresults','Reminder','This is the reminder program reminding you that the reminder program is working!'
GO
Software Engineer
Team Lead
damn bill gates, he has everything