Many thanks for your time
Thank-you both for responding to my query. I would agree that Les's solution does seem to be more straight forward but limited to SQL Server, but I'm sure it possible to extend this. I did look at the code generated by the BOM and wondered if it were possible to write a generic version, but it's only a fledgeling thought at the moment. I'm still considering my options.