Hi Tom, I think this is a maths problem more than a SQL one. Good fun!

At first I thought "just MD5 hash the original string to 16 bytes and store the 32 hex chars".

Then you said you'd like to convert back, which sank my idea. The only option left is compression, but I'll bet it would be a miracle if all of your original strings could be roundtripped via 32 compressed characters.

Greg K