Microsoft.SqlServer.Types assembly version RRS feed

  • Question

  • I need to know with version of Microsoft.SqlServer.Types assembly SQLServer is using to load spatial data types. I need to get this information by selecting from system tables. There are at least two tables which contain this information, but both of them have different versions:

    If I select from SYS.ASSEMBLY_TYPES, I get version 11, and if I select from SYS.ASSEMBLIES, I get version 13:

    "SELECT assembly_qualified_name FROM SYS.ASSEMBLY_TYPES WHERE assembly_id = 1" returns:

    Microsoft.SqlServer.Types.SqlHierarchyId, Microsoft.SqlServer.Types, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91
    Microsoft.SqlServer.Types.SqlGeometry, Microsoft.SqlServer.Types, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91
    Microsoft.SqlServer.Types.SqlGeography, Microsoft.SqlServer.Types, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91

    "SELECT clr_name FROM SYS.ASSEMBLIES WHERE assembly_id = 1" returns:

    microsoft.sqlserver.types, version=, culture=neutral, publickeytoken=89845dcd8080cc91, processorarchitecture=msil

    Why these versions are different, and how to know which one is correct?

    Friday, March 30, 2018 12:38 PM

All replies

  • Hi Saulius_1,

    Besides the SQL Server 2016, how many versions of SQL Server did you install on your machine?

    SELECT clr_name FROM SYS.ASSEMBLIES should return the true version of Microsoft.SqlServer.Types namespace, for SQL Server 2016, it should also return the please go to C:\Program Files (x86)\Microsoft SQL Server\130\SDK\Assemblies to chekc the version of Microsoft.SqlServer.Types.dll.

    I tested the SELECT assembly_qualified_name FROM SYS.ASSEMBLY_TYPES on my machine, but it returns the Null to me. The version returned from your query may be the version of Microsoft.SqlServer.Types.SqlHierarchyId rather than the Microsoft.SqlServer.Types.dll.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 2, 2018 6:08 AM