Was it wrong to set WITH PERMISSION_SET = UNSAFE in SQL 2005?

I need to use the CLR to create a stored procedure that uses stuff in .net 3.5. If I do not set Permission_Set = UnSafe, I can not do this, it will just die and give me this error

Deployment Error SQL01268: .Net SqlClient Data Provider: Msg 6503, Level 16, State 12, Line Assembly 1 'system.core, version = 3.5.0.0, culture = neutral, PublicKeyToken = b77a5c561934e089. was not found in the SQL directory. The error occurred when the batch was running.

So I found this article

http://weblogs.asp.net/paulomorgado/archive/2009/06/13/playing-with-sql-server-clr-integration-part-iv-deploying-to-sql-server-2005.aspx

And the last line says it

"Now, database administrators won't necessarily let me use this, but it was great to build it." I'm not sure that he was referring to permissions set to insecure.

So some huge hole could happen if you do this?

+3
source share
2 answers

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

+5

, , "UNSAFE" ?

:

  • SQL Server .

, " CLR 2005?" , , ..

-3

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


All Articles