none
VS2010 corrupts SQL Server 2012 DB --- Workarounds, or is this a feature?

    Question

  • I've found a bug where EF 4.0 in VS2010 corrupts a SServer 2012 Express DB by not using the .ldf file created for the DB in SQL Server, but instead creates a unique file.  After that point SQL Server whines about the primary file not matching the logfile and the DB is set in "Recovery Pending" state, forcing a restore of the DB from backup.

    I'm trying to work through Julie Lerman's book Programming Entity Framework 2nd Edition.  I've raised the issue on her forum for her book at O'Reily, but she hasn't logged onto the site since April, so I'm not too confident she'll be responding any time soon.

    Here is the directory after creating the DB, but before trying anything from VS:

    E:\Program Files (x86)\Microsoft SQL Server\MSSQL11.SAMPLES\MSSQL\DATA>dir programmingefdb2*
    
     Directory of E:\Program Files (x86)\Microsoft SQL Server\MSSQL11.SAMPLES\MSSQL\DATA
    
     08/09/2013 11:39 AM 10,485,760 PROGRAMMINGEFDB2_Data.mdf
     08/09/2013 11:39 AM 1,310,720 PROGRAMMINGEFDB2_Log.ldf
     2 File(s) 11,796,480 bytes
     0 Dir(s) 250,238,443,520 bytes free

    Here is the directory after making the connection in the VS project but without even trying to run any update code (and without copying the DB into the project):

    E:\Program Files (x86)\Microsoft SQL Server\MSSQL11.SAMPLES\MSSQL\DATA>dir programmingefdb2*
    
     Directory of E:\Program Files (x86)\Microsoft SQL Server\MSSQL11.SAMPLES\MSSQL\DATA
    
     08/09/2013 11:51 AM 10,485,760 PROGRAMMINGEFDB2_Data.mdf
    08/09/2013 11:51 AM 516,096 PROGRAMMINGEFDB2_Data_log.ldf
     08/09/2013 11:39 AM 1,310,720 PROGRAMMINGEFDB2_Log.ldf
     3 File(s) 12,312,576 bytes
     0 Dir(s) 250,237,927,424 bytes free

    So, I'll ask my question again, "Does Microsoft support and fix bugs in Express Editions of their software, or does the user have to pay MS to fix bugs in their code?

    How am I supposed to update a DB managed by SQL Server if VStudio corrupts the DB?

    Wednesday, August 21, 2013 11:09 PM

Answers

  • If anyone of the 40 or so folks that have viewed this thread are interested in the solution, see the following link:

    http://social.msdn.microsoft.com/Forums/en-US/8534ee7c-f61e-4ced-9bba-bb1fcc23243d/vs2010-corrupts-sql-server-2012-db-workarounds-or-is-this-a-feature

    • Marked as answer by jetgg Thursday, August 22, 2013 11:55 PM
    Thursday, August 22, 2013 11:55 PM

All replies

  • If anyone of the 40 or so folks that have viewed this thread are interested in the solution, see the following link:

    http://social.msdn.microsoft.com/Forums/en-US/8534ee7c-f61e-4ced-9bba-bb1fcc23243d/vs2010-corrupts-sql-server-2012-db-workarounds-or-is-this-a-feature

    • Marked as answer by jetgg Thursday, August 22, 2013 11:55 PM
    Thursday, August 22, 2013 11:55 PM
  • Hi Jetgg,

    Thank you for sharing your experience here. It will be very beneficial for other community members who have similar questions.

    Regards,


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, August 26, 2013 2:37 AM
    Moderator