Just write a SQL-CLR function and call that Smiley