snippetsqlModerate
How can "HierarchyID" type work when "CLR" is disabled?
Viewed 0 times
canclrdisabledtypehierarchyidworkhowwhen
Problem
The following statement
I assume this means there are no
I have read that
How can it be used without having
sp_configure 'clr enabled' returns:name minimum maximum config_value run_value
clr enabled 0 1 0 0I assume this means there are no
CLR objects; however if I execute the following statements I get these:SELECT * FROM sys.assembly_filesSELECT * FROM sys.assembly_typesI have read that
The HierarchyID type is available to CLR clients as the SqlHierarchyId data type..How can it be used without having
CLR enabled and why do I need to enable it to create my own CLR objects?Solution
The
The
Similarly, other system features that rely on CLR integration, like
If you need to manipulate
See also: Hierarchical Data (SQL Server)
clr enabled server configuration option only controls whether user assemblies can be run by the SQL Server instance.The
hierarchyid, geometry and geography types are system CLR types. These are contained in system assemblies, so are available regardless of the clr enabled setting. Similarly, other system features that rely on CLR integration, like
FORMAT (SQL Server 2012 onward) are available even if clr enabled is off.If you need to manipulate
hierarchyid data in a custom CLR routine, you will need to enable user clr assemblies via this setting.See also: Hierarchical Data (SQL Server)
Context
StackExchange Database Administrators Q#77608, answer score: 10
Revisions (0)
No revisions yet.