There are three different permission settings that limit build options.
SAFE - limits assembly to managed code
EXTERNAL_ACCESS - Allows access to files, network resources, etc.
UNSAFE - Unlimited access - including the execution of unmanaged code
MSDN docs give the following recommendations
UNSAFE SQL Server, SQL Server. UNSAFE SQL Server . UNSAFE .
.NET 3.5, , UNSAFE .
, , System.Core. Microsoft . System.Core.dll
. CLR