Hey
Im sure this is possible, i just need to find the right way to do it.
Overview
An existing database created by a previous guy years ago, converted from Access. I cannot change the database or table structures.
Requirement
Return job info from a job table using the job_id
add a boolean value to the return row where only a string value can be captured from another stored procedure
Stored Procedure 1
ALTER PROC [dbo].[usp_GetJobList]
@job_id int = null,
@thermal_break bit = False
AS
SET NOCOUNT ON
SET XACT_ABORT ON
SELECT dbo.job.job_id, dbo.job.name, dbo.job.short_description, @thermal_break AS thermal_break
FROM dbo.job
WHERE dbo.job.job_id = @job_id
ORDER BY dbo.job.job_id DESC
Stored procedure 2
ALTER PROC [dbo].[usp_GetThermalBreak]
@job_id int = NULL
AS
SET NOCOUNT ON
SET XACT_ABORT ON
SELECT dbo.lookup_in_ex.description_memo AS thermal_break
FROM dbo.job_in_ex INNER JOIN
dbo.lookup_in_ex ON dbo.job_in_ex.in_ex_id = dbo.lookup_in_ex.id
WHERE (dbo.job_in_ex.job_id = @job_id) AND (dbo.job_in_ex.in_ex_id = 43)
Objective
GetJobList returns a single row. I need to collect the thermal_break value from GetThermalBreak and set @greg@thermalcloudsolutions.com _break (or an alternative method)
GetThermalBreak returns a single string value that is either 'thermal break' or nothing WHERE job_id = @Job _id
i need to get the value from GetThermalBreak
If the return value = 'thermal_break', return True
Else return False
How can i set this up in procedure 1 so that i can call GetThermalBreak using the job_id and return its value as a true or false boolean and then add the return value to the datarow so i get something like
job_id name thermal_break
123456 some job description True
246810 some other job False
Thanks