Search code examples
visual-studio-2010stored-proceduressql-server-data-tools

Visual Studio 2010 with SSDT not recognizing some objects


I have a couple of different database projects in an existing solution and I'm experiencing some strange behavior. 99% of the database objects that I define with the projects work just fine, but a handful are not being recognized as part of the project when a schema compare is done. It's just like they don't even exist. So far they appear to all be stored procs that are skipped.

I created them just like all of the rest of the objects.

What information might you need to debug this?


Solution

  • I found one reason why objects were not being created. Some of the files were initially created as Script files instead of Stored Procedure files. It appears as though the database project keeps track of which files represent objects that need to be synchronized.

    The tick is knowing if you have a database object sql file or a script sql file. One easy way to know you're in a script file is that they will have a menu bar within the content area (beneath the tabs), where as files created as functions or stored procedures will not. The menu bar has things like Execute, Parse, Connection settings, SQLCMD mode, as well as others.


    As pointed out by a colleague, the difference seems to be the Build Action property. The synchronized files seem to all have the Build Action set to Build