none
What could possibly be happening to give me this error?????

    Question

  • I am running a "simple" query from within Management Studio and I'm getting the following error, what could possibly be happening?  (It seems to blow up on a geography column)

    select * from company where category like '%hospital%'

    An error occurred while executing batch. Error message is: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

    When I run this query, it works:

    select company_name, address_line_1, city, state, zip, latitude, longitude
     from company where category like '%hospital%'

    But, when I add a geography field...

    select company_name, address_line_1, city, state, zip,latitude,longitude,location_geography
     from company where category like '%hospital%'

    It blows up with the error above.

    I've run this query many times before, however, here is what has changed, I've upgraded to Windows 8 and was also required to upgrade to the latest Management Studio 2012 (see version, etc. info below).

    Microsoft SQL Server Management Studio      11.0.2100.60
    Microsoft Data Access Components (MDAC)      6.2.9200.16384
    Microsoft MSXML      3.0 4.0 6.0
    Microsoft Internet Explorer      9.10.9200.16519
    Microsoft .NET Framework      4.0.30319.18033
    Operating System      6.2.9200

    I know it's the OS or MDAC drivers (as I'm getting the same error in c# code), but it works fine from my windows 7 laptop with SQL Management Studio 2008 R2.  I'm using the same database on a remote server.

    Can anyone tell me what's going on here?  This is crazy. :(

    Bob

     

    Wednesday, April 03, 2013 8:19 PM

Answers

All replies

  • It could have been a newly introduced bug. Start from searching MS connect and if you will not find your problem, you may want to create a new Connect issue.

    I'll send this thread to a few MS folks I know in the meantime.


    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    Wednesday, April 03, 2013 9:40 PM
  • Could you create some scripts (create/insert) which will let us try to reproduce this error in different environments?
    Wednesday, April 03, 2013 9:58 PM
  • We do not use SELECT * in production code. Category by itself is absurd; you need to read ISO-11179 or any book on data modeling. Do you really have only one company in the table? That is what the singular names says.

    Are you familiar with SIC or NAICS codes? For example, HMO Medical Centers = '621491', and so forth. Why invent your own categories? Get all of that stuff your taxes paid to create; it is free and you can download it. http://www.naics.com/searchresultsnew.php 

    >> But, when I add a geography field [sic: columns are not anything like fields]...

    SELECT company_name, address_line_1, city_name, state_code,
           company_zip, company_latitude, company_longitude 
      FROM Companies 
     WHERE naics IN ( ..); 

    Boy, I sure I had DDL and some specs to explain what kind of attribute a “location_geography” is in the database logical model because that name makes no sense. We do not put meta data like proprietary environmental meta data. It always comes back to bite you. 

    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking in Sets / Trees and Hierarchies in SQL

    Wednesday, April 03, 2013 10:06 PM
  • I would suggest installing the current SQL 2012 service pack and see if the problem is resolved.

    http://support.microsoft.com/kb/2755533

    Wednesday, April 03, 2013 10:20 PM
  • Since it only happens from one client, and only when retrieving spacial data, it's probably to do with the client-side spacial type libraries.  That error message generally means that you tried to load a .DLL of the wrong "bitness" for your process.  EG a 32bit process (like SSMS) trying to load a dll compiled only for x64.

    You can download them alone here:


    David http://blogs.msdn.com/b/dbrowne/

    Wednesday, April 03, 2013 10:25 PM
  • I tried this and it didn't work...and since I don't have time to fight this now, I uninstalled 2012 and reinstalled 2008R2 and I'm back working again. :)

    Thank you for the suggestion...too bad it didn't work.

    Bob

    Thursday, April 04, 2013 4:02 PM
  • I tried this too and it didn't work...and since I don't have time to fight this now, I uninstalled 2012 and reinstalled 2008R2 and I'm back working again. :)

    Thank you for the suggestion...too bad it didn't work.

    Bob

    Thursday, April 04, 2013 4:02 PM
  • Did you have SP1 for 2012? Also, can you give us a quick repro scenario, if possible?

    I think MSFT people should look into it a bit closer in case it's indeed a reproducible problem in Windows 8.


    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    Thursday, April 04, 2013 5:03 PM
  • It's really as simple as my first post. Yes I upgraded to sp1 before I gave up and uninstalled. I wish I could be more helpful, but it was just weird. Bob
    Friday, April 05, 2013 1:16 AM