News

Tweets












June 2009 Entries


Request for the permission of type 'System.Data.SqlClient.SqlClientPermission failed Error

After some time working on another SQL CLR I am getting an error Request for the permission of type 'System.Data.SqlClient.SqlC... System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=' failed. This procedure needed to access a stored procedure on a remote server. Running that stored procedure within SQL Server Management Studio completed successfully. It just would not execute from my SQL CLR ! Doing online research did not lead to a solution. Nearly completely tired I dropped ......

CREATE ASSEMBLY Failed Error

I was doing some new CLR Stored Procedures in SQL Server 2005 and at a certain point received error: CREATE ASSEMBLY failed because method 'MyMethod' on type 'StoredProcedures' in safe assembly 'MyAssembly' is storing to a static field. Storing to a static field is not allowed in safe assemblies. Interestingly, despite all the procedures inside SQL CLR stored procedures have to be declared as static, no static fields are allowed outside them. So in my case declaring a static variable outside SqlProcedure. ......