Question

When using the Schema Compare tool with SSDT in Visual Studio 2012 to update a database project with changes made to schema objects on a local database, the schema is 'lost' from the object declaration. I am connected to my local sql server instance using a Windows account and this account has default schema of dbo on the database being compared.

For example, a local stored procedure definition may be:

CREATE PROCEDURE [dbo].[SetPriceBounds]

But when this is added to the database project using schema compare, it becomes:

CREATE PROCEDURE SetPriceBounds

When this is subsequently deployed to another SQL Server instance, it fails with the error:

The default schema does not exist.

I need to get the dbo. prefix preserved when the schema comparison is executed, any ideas are welcome.

Was it helpful?

Solution

This has been solved by setting the default schema on the deployment target database to dbo for the user that was performing the deployment. I'm not convinced this is the right way to fix the problem, but it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top