7

Running SQL Server in fibre mode (lightweight pooling) disables the use of SQL CLR:

Common language runtime (CLR) execution is not supported under lightweight pooling. Disable one of two options: "clr enabled" or "lightweight pooling". Features that rely upon CLR and that do not work properly in fiber mode include the hierarchy data type, replication, and Policy-Based Management.

On the other hand, disabling SQL CLR alone (without enabling lightweight pooling) does not disable the built-in CLR types like geometry, and geography (though hierarchyid is mentioned above), as shown in How can "HierarchyID" type work when "CLR" is disabled?

Now some new language features rely on the CLR, for example the FORMAT function:

FORMAT relies on the presence of the .NET Framework Common Language Runtime (CLR).

Does running SQL Server in fibre mode disable the FORMAT function and/or using the CLR types?

1 Answer 1

10

Yes.

When running in fibre mode, everything that needs the CLR is unavailable, including AT TIME ZONE.

For example, both:

SELECT FORMAT(GETDATE(), N'd', N'en-us');

and:

DECLARE @g geometry;
SELECT @g;

...return the (slightly misleading) error message:

Msg 5846, Level 16, State 2, Line 13
Common language runtime (CLR) execution is not supported under lightweight pooling.
Disable one of two options: "clr enabled" or "lightweight pooling".

It is the lightweight pooling that is the problem, no setting of the clr enabled option will allow CLR execution of any kind under lightweight pooling.

1
  • That is definitely a poorly worded error message, at least in that context. It makes the false assumption that the CLR-based functionality being attempted is from a user created Assembly, and so you need to choose one xor the other. They should have simply said: "Disable lightweight pooling to use CLR-based functionality (or because you shouldn't be using it anyway)". Though to be fair, this error message was probably just meant for when someone tries to use sp_configure to set both clr enabled and lightweight pooling to 1 at the same time, in which case the message does make sense. Jul 13, 2018 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.