I think you would be helped by a code generation tool.
Either write some TSql ( or other ) code that will generate the desired Name - Value pairs for You. Or try one of the commercial tools ( some are free )
You could find some sample tools at:
http://www.codegeneration.net
/rockmoose
You must unlearn what You have learnt