visual-studio-2010visual-studio-dbpro

TSD00563 Deployment may encounter errors because it depends on [sys].[sp_executesql] and it does not exist in the target database


I'm running into a very annoying issue. One of our SPROC is building up a dynamic bit of SQL which is then executed with sp_executesql (please let's not go into the issues with building up SQL strings for execution).

Using Visual Studio 2010 Database Project (aka. DataDude) to to schema comparisons and deployments and I'm getting the error below for the SPROC:

TSD00563 This deployment may encounter errors during execution because [dbo].[MYSPROC] depends on [sys].[sp_executesql] and [sys].[sp_executesql] does not exist in the target database

Does anyone know how I can get around this?

I have a reference to the master database schema file, but it makes no difference. Also, it's not referencing master, but sys instead.

Many thanks, Jaans


Solution

  • Use a . prefix before the [sys].[sp_executesql]

    Here's an example EXEC .sys.sp_executesql 'SELECT * FROM Table'

    Strange indeed!