I’ve found an interesting bug in SQL Server Data Tools, version is 12.0.50717.0.
I have a database project. After I published the project to SQL server, I wanted to examine the code via SQL Server Object Explorer. I double-clicked the stored procedure, and SSDT showed me the code (at this time it was identical to the code in database project).
Then I close the tab, and open the code of the same stored procedure in the database project. I’ve made some slight correction.
Now I return to SQL Server Object Explorer. Double-click SP again. But I see the modified code from the database project. Why? I expect that Explorer would show the code on the server.
To be sure, I also check the code on the SQL Server via SQL Server Management Studio. The code on the server really differs from the code in database project. So, it’s just a bug in SSDT 🙁
Update August 19, 2015
It’s not a bug, it’s just a feature of SSDT 🙂
It depends on the connection that was set in Debug tab of the database project’s Properties window. When you open an object in SQL Server Object Explorer from the same database (from Debug tab), SSDT shows the code from the database project. If this is the other database (different from Debug tab), SSDT shows the code from the server. In the last case it also shows a different tab name (something like dbo.SP_Name) and the Update button.