2

I am using VS 2019 and comparing 2 databases using Schema Compare. Most of the time it finds the differences just fine and replicates them across. However, on some Stored Procedures it highlights a difference because of a schema name missing. e.g. [dbo]

Example:

Left Panel (local DB)

CREATE Procedure MyNewProcedure
(
  @prmParam1 int
)
Select * from TableA where Id = @prmParam1

And on the Right hand Panel (remote DB) it shows the schema name correctly:

CREATE Procedure [dbo].[MyNewProcedure]
(
  @prmParam1 int
)
Select * from TableA where Id = @prmParam1

If I run the update, it will create another version of this stored procedure but it won't belong to the dbo schema - it will take on the schema name of the connection.

It only does this for a handful of stored procedures. All the rest it adds the [dbo]. to each of the create statements.

I can not figure out why as I have to manually create the SP on the remote DB and then do an Exclude for each of these in the compare so it won't delete my new SP on the remote and create the new one without the [dbo].

Anyone got any ideas or seen this before?

I don't think I am creating the original SP (local) in any different way. Just a blank New Query window and type it in and hit F5.

Thanks in advance,

Ro

Rowie
  • 243
  • 5
  • 17

0 Answers0