Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Risks in Enabling CLR?

Author  Topic 

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2013-08-20 : 13:14:55
hi experts,

Our developers have found a tool that requires CLR to be enabled (we use 2008 R2 Enterprise)

Do you know of any potential disadvantages that I should consider before enabling Common Language Runtime?

Thanks, Jack

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2013-08-20 : 17:25:19
The issue for me is what is the CLR entity doing and is this a good use of (limited) database resources. A problem can be solved in a number of ways so there will be solutions that can be foisted on the database but might be better implemented at a different layer; string manipulation and formatting being examples. You will lose some visibility into what is in the CLR entity. With native code objects (functions, sprocs, etc.) you have some confidence that they should play nicely within the SQL engine architecture. Also, if you don't know what's in the CLR entity, how will you apply security correctly?

$.02

=================================================
The cure for anything is salt water -- sweat, tears, or the sea. -Isak Dinesen
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2013-08-20 : 18:36:00
It depends. Does the assembly require UNSAFE or EXTERNAL permission? If so, yes, I would be hesitant.
If only SAFE mode is required, there is nothing the code can do that a normal SP couldn't match.


Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2013-08-21 : 15:21:38
Thanks for your advice, Bustaz and SwePeso.

The instructions for installing this .DLL call for the Assembly to use the SAFE Permissions set, so I think this will be OK.

Pls see below.
Jack


CREATE ASSEMBLY HeatMap from 'c:\HeatMap\HeatMap.dll' WITH PERMISSION_SET = SAFE

CREATE PROCEDURE dbo.CreateHeatMap (@Width real, @Height real, @SqlStrng nvarchar(4000))
AS
EXTERNAL NAME HeatMap.StoredProcedures.TreeMapGeography
Go to Top of Page
   

- Advertisement -