I need a function that checks if a GUID (provided as a varchar parameter) is valid.
The function should returns a UNIQUEIDENTIFIER if the GUID is valid, otherwise NULL
The function should permit GUIDs that have no hyphens (a form we tend to use in links in EMails etc. so that they don't get mucked up by hyphens being word-wrapped or URL-encoded. Thus the function is both a test and a "cleanup"