CLR Function not working in restored database
So I've restore a database with CLR assemblies in it from one physical server to another. One of the functions in the CLR assembly essentially does an uncompress of some compressed data. When I run this function against data in the restored database it returns the compressed data (rather than the 开发者_如何学编程uncompressed data). No error is thrown in SSMS or in the SQL server error logs. At the suggestion of others, I've checked differences in the database ownership (both owned by sa), trustworthiness (both set to not trustworthy). I also checked differences in the .NET framework installs on both machines but found only that the target machine had a 1.1 version installed that the source didn't. I don't know what else to try. Any suggestions would be most appreciated. Thanks in advance.
Thanks in advance, Ben
Okay... I feel silly now. It turns out the issue was that a change was made to the application to compress the data on the app side before sending it to the database instead of using SQL CLR to do it. The stored procedure responsible for writing the data wasn't updated and so it was compressing the already-compressed data and storing that. So, when I went to uncompress it, it was giving me back compressed data. Had I run the uncompress function again, it would have given me the right thing.
精彩评论