I am creating a view that is using that STUFF
function. I want to put the result of STUFF
in a variable for my view. The problem I am having is dec
You can't declare variables in a view. Could you make it into a function or stored procedure?
Edit - you might also be able to put something into a CTE and keep it as a view.
e.g.
with conditions as
(
... do the STUFF here
)
select blah
from blah
inner join conditions
(or cross join conditions if its just one row, I can't quite decipher what your data is like)