In SQL 2005 encryption functions are nondeterministic, which means that every time a function is called, the output will be different, even if exactly the same input was used. Here is great article about existing workarounds. http://blogs.msdn.com/raulga/archive/2006/03/11/549754.aspx