title: Base64 encoding in SQL Server 2005 T-SQL
body: <p>I'd like to write a T-SQL query where I encode a string as a Base64 string.  Surprisingly, I can't find any native T-SQL functions for doing Base64 encoding.  Does a native function exist?  If not, what's the best way to do Base64 encoding in T-SQL?</p>