I need to build values based on some variables in this stored procedure and can't get it to work.
My sql select is very basic
create table #results
null(value of @CRD_PRSN_SUFFIX goes here)
So from that result set I need to capture the suffix for each name_id and a stored procedure must be run to get the result. Can I run my variables in there where the @name_id = a.name_id ? Then run an update in my #results table as it is compiling? Or I could build another temp temp with the results of this stored procedure and map to my #results table. Which method would be best?
This is the stored procedure where the suffix is identified for each name_id: