Hi Luis,
Thanks a lot of for the reply. I'm now storing the results in a table as you suggest. I'm not familiar with dynamic SQL or how to use it with SP_EXECUTESQL, but as you've made me aware of them I will be reading around these soon.
Many thanks,
Dave.
Dave Morris :alien:
"Measure twice, saw once"