I have a stored procedure SP1 that takes the @ param1 parameter and does a bunch of things with it and returns a value.
Now I have a table consisting of two columns, for example C1 and C2. Initially, C1 has different values for each row, and C2 has 0 in each row. Now I want to update C2 with the value returned by SP1, with its corresponding C1 value as @ param1. I was hoping for something like:
update Table1 set C2 = (exec SP1 @param1=C1)
same as getting the return value from a function in most programming languages.
I did not learn SQL, but I learned a lot without finding anything. Therefore any help would be appreciated.
source
share