Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news2.arglkargh.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: comp.databases.ms-sqlserver Subject: Re: SQL 2012 CLR Function Causing Error: - Msg 6522, Level 16, State 1, Line 3 A .NET Framework error occurred during execution of user-defined routine or aggregate. CLR Function Causing Error: Date: Mon, 15 Jun 2015 23:13:44 +0200 Organization: Erland Sommarskog Lines: 27 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="649a6bf9a71a2d72d51c0c898eded6c7"; logging-data="12004"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1859UbLvqaZeW47L7vupYgt" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:7rZLa4pCIu+D+rUlkVl6FhtVM7M= Xref: csiph.com comp.databases.ms-sqlserver:1922 Query Builder (querybuilder@gmail.com) writes: > We are in the process of migrating our SQL 2008 R2 Enterprise Edition > environment to a new SQL Server 2012 Enterprise Edition. What does "SELECT @@version" report for the new server? > The function returns fine most of the time, but at intermittent times, > its giving me the following error: > > > Msg 6522, Level 16, State 1, Line 3 > A .NET Framework error occurred during execution of user-defined routine > or aggregate "": >... > We have played with PERMISSION_SET to be SAFE EXTERNAL_ACCESS and also > switched the trustworthy Property on the database. So what was the permission set of the assembly originally? Assuming that it was SAFE, the fact that you get a stack dump indicates a bug in SQL Server - or a hardware problem like bad memory board. In this case you should verify that you have the most recent Service Pack installed. If that does not resolve the issue, open a case with Microsoft that can analyse the stack dump. If you have an unsafe assembly, you better do your homework before you open a case. -- Erland Sommarskog, Stockholm, esquel@sommarskog.se