locked
Geography fields in SQL Server 2012 RRS feed

  • Question

  • I have SQL Server 2012 running in 2012 mode.

    I run IIS 7.5 on Windows Server 2008.

    I use ASP.NET and after the login form, I issue a SQL select command which include the selection of a Geography field in the result.

    In order to make that work, I have to install:

    Microsoft SQL Server 2008 Shared Management Objects
    Microsoft SQL Server 2012 Shared Management Objects x86
    Microsoft SQL Server 2012 Shared Management Objects x64
    Microsoft System CLR Types for Microsoft SQL Server System 2008
    Microsoft System CLR Types for Microsoft SQL Server System 2012 x86
    Microsoft System CLR Types for Microsoft SQL Server System 2012 x64

    If I remove the 2008 installations, it will break. I do not understand why I have to continue to support old 2008 installation files just to benefit of Geography fields in 2012. It seems there is some kind of dependencies in 2012 in regard to Geography fields that it continues to require the installation of those 2008 components.

    I really need to get rid of that and only keep:

    Microsoft SQL Server 2012 Shared Management Objects x64
    Microsoft System CLR Types for Microsoft SQL Server System 2012 x64

    If someone has any idea, you may let me know.

    Tuesday, March 11, 2014 5:24 PM

Answers

  • I have found a workaround for this issue.

    Type System Version=SQL Server 2012 can be added to the connection string. On all those alternatives I have found, this one is the simpler and does not require any change in the code.

    I was able to remove the following:

    Microsoft SQL Server 2008 Shared Management Objects

    Microsoft System CLR Types for Microsoft SQL Server System 2008

    ...and the application is now working.

    So, for now, I have those installed:

    Microsoft SQL Server 2012 Shared Management Objects x86
    Microsoft SQL Server 2012 Shared Management Objects x64
    Microsoft System CLR Types for Microsoft SQL Server System 2012 x86
    Microsoft System CLR Types for Microsoft SQL Server System 2012 x64

    I would like to keep only the 64-bit version but I need to keep the 32-bit version because I have some script that requires BatchParser. That one does not exist in the 64-bit version. So, once I installed back the 32-bit version, it went ok.

    The fact that I had to modify the connection string to have the Geography field to be workable in the ASP.NET application is an issue. I hope this will be resolved soon. I do not know if this has to be resolved at SQL Server level, .NET or ASP.NET. But, one thing for sure, I shouldn't have to plug that in the connection string to workaround such issue.





    • Edited by MichelFournier Thursday, March 13, 2014 9:22 PM
    • Proposed as answer by Bob Beauchemin Sunday, March 16, 2014 1:58 AM
    • Marked as answer by Fanny Liu Tuesday, March 18, 2014 8:18 AM
    Thursday, March 13, 2014 9:20 PM

All replies

  • Did you check to see that you're referencing the correct version of SMO and CLR types dlls in your ASP.NET code?

    Cheers, Bob

     
    Tuesday, March 11, 2014 6:59 PM
  • Hi Bob

    Thanks for the answer

    At first, yes, someone would have thought that this would have been the issue. I was in fact having references to 10.0.0.0 libraries of:

    Microsoft.SqlServer.ConnectionInfo

    Microsoft.SqlServer.Management.Sdk.Sfc

    Microsoft.SqlServer.Smo

    Microsoft.SqlServer.SmoExtended

    So, I replaced that with references to 11.0.0.0 libraries.

    Then, I uninstalled:

    Microsoft SQL Server 2008 Shared Management Objects

    Microsoft System CLR Types for Microsoft SQL Server System 2008

    And, as soon as I access a geospatial field, this breaks. The only way that the code would not break is to reinstall back those two packages.

    Wednesday, March 12, 2014 8:31 PM
  • I have found a workaround for this issue.

    Type System Version=SQL Server 2012 can be added to the connection string. On all those alternatives I have found, this one is the simpler and does not require any change in the code.

    I was able to remove the following:

    Microsoft SQL Server 2008 Shared Management Objects

    Microsoft System CLR Types for Microsoft SQL Server System 2008

    ...and the application is now working.

    So, for now, I have those installed:

    Microsoft SQL Server 2012 Shared Management Objects x86
    Microsoft SQL Server 2012 Shared Management Objects x64
    Microsoft System CLR Types for Microsoft SQL Server System 2012 x86
    Microsoft System CLR Types for Microsoft SQL Server System 2012 x64

    I would like to keep only the 64-bit version but I need to keep the 32-bit version because I have some script that requires BatchParser. That one does not exist in the 64-bit version. So, once I installed back the 32-bit version, it went ok.

    The fact that I had to modify the connection string to have the Geography field to be workable in the ASP.NET application is an issue. I hope this will be resolved soon. I do not know if this has to be resolved at SQL Server level, .NET or ASP.NET. But, one thing for sure, I shouldn't have to plug that in the connection string to workaround such issue.





    • Edited by MichelFournier Thursday, March 13, 2014 9:22 PM
    • Proposed as answer by Bob Beauchemin Sunday, March 16, 2014 1:58 AM
    • Marked as answer by Fanny Liu Tuesday, March 18, 2014 8:18 AM
    Thursday, March 13, 2014 9:20 PM