CLR function does not work in a restored database

So, I am restoring a database with CLR assemblies in it from one physical server to another. One of the functions in the CLR assembly essentially does not compress some compressed data. When I run this function against data in a restored database, it returns compressed data (and not uncompressed data). The error does not occur in SSMS or in SQL Server error logs. At the suggestion of others, I checked the differences in the owner of the database (both belong to sa), reliability (both are not trustworthy). I also checked the differences in the settings of the .NET framework on both machines, but found only that version 1.1 was installed on the target machine, which the source did not use. I do not know what else to try. Any suggestions would be most appreciated. Thanks in advance.

Thanks in advance Ben

+4
source share
1 answer

Okay ... Now I feel stupid. It turns out the problem was that a change was made to the application to compress the data on the application side before sending it to the database, rather than using the SQL CLR for this. The stored procedure responsible for recording data was not updated, and therefore it compressed already compressed data and saved it. So, when I went to send it, it returned me the compressed data. If I ran the uncompress function again, this would give me the right thing.

+1
source

Source: https://habr.com/ru/post/1334764/


All Articles