Answered T-SQL Code Reverting on Execute

  • Tuesday, May 22, 2012 4:16 PM
     
     

    I've installed the latest SSDT into VS2010 and have found a very irritating feature.

    I change a function or stored procedure, update the database succesfully and then execute the calling stored procedure. The SP completes succesfully and returns the data.

    However, the code it executes is not the current version (stepping through in debug shows the current line marker on blank lines), and reopening the query shows that it has magically reverted to before the code update.

    I'm running VS 2010 SP1 against SQL Server Express 10.0.2531 on a 64-bit Windows 7 workstation.

    I'm using the default settings for SSDT and SQL Server, so what am I doing wrong??

    Thanks for any suggestions.

All Replies

  • Tuesday, May 22, 2012 6:12 PM
     
     

    Hi Nigel

    Are you using the same connection string for debugging and publishing? It may be that you're publishing changes to your production box, but debugging against your localDb. The default is debugging against localDB.

    To change the settings,

    1. Right click on your datbase project, and choose "Properties".
    2. Select the "Debug" tab
    3. Click on the "Edit" button
    4. Connect to the database of your choice using the connection dialog.

    Screenshot of changing the connection string

    Hope that helps,

    -Sam


    • Edited by Sam Hughes Tuesday, May 22, 2012 6:13 PM
    •  
  • Tuesday, May 22, 2012 6:47 PM
     
     
    Sam, Interesting idea I'll check out tomorrow. But... I think I've only got SSDT connected locally. However, the older VS tools are connected to both, I wonder whether that could be confusing things? Thanks for the speedy response, Nigel
  • Wednesday, May 23, 2012 9:14 AM
     
     

    No, this doesn't solve the problem.

    An interesting side effect is that when debugging, in some cases the "current line" indicator is actually pointing at an empty line in the displayed code (which is the "old" version of the code):

    Unfortunately this is affecting my current project so badly I'm uninstalling SSDT.

    • Edited by Nigel Rex Wednesday, May 23, 2012 9:21 AM
    •  
  • Thursday, May 31, 2012 9:05 PM
     
     

    Oh I'm sorry to hear this is still an issues.

    Is there any chance you could send us a sample project that's having this issue? I've asked the developers to look in to it. I'd like to see if we can get to the bottom of this. Worst case you found a bug that we need to fix.

    my email is [Redacted] 


    • Edited by Sam Hughes Monday, June 18, 2012 8:42 PM
    •  
  • Monday, June 18, 2012 8:43 PM
     
     Answered

    Hi Nigel,

    We are unable to reproduce this issue as written.  If any further detail is provided via this thread or email, we’ll be happy to reopen investigation of the issue.

    Thanks,

    -Sam