Forcing owner (dbo)
sevder
Posts: 3
Hi,
Whenever I try to sync my development to hosted SQL, I see that I always have differences. Because dbo is not forced as owner.
E.g. script:
PRINT N'Creating [dbo].[sp_SevDerTabsGet]'
GO
CREATE PROCEDURE sp_SevDerTabsGet
AS you see it prints with [dbo] but not executing with [dbo].
How can I force this?
Right now I need to open the script add them 1 by one.
Whenever I try to sync my development to hosted SQL, I see that I always have differences. Because dbo is not forced as owner.
E.g. script:
PRINT N'Creating [dbo].[sp_SevDerTabsGet]'
GO
CREATE PROCEDURE sp_SevDerTabsGet
AS you see it prints with [dbo] but not executing with [dbo].
How can I force this?
Right now I need to open the script add them 1 by one.
Comments
This is caused by information that is inconsistent between the actual object definition, and the owner name as it appears in the database's system tables. This happens normally as the result of implicit ownership because the owner name was not specified when the object was created.
In SQL 2000, the only way to fix this is to edit the stored procedure (alter or drop and recreate it), as you've found out.
What about SQL 2005? I am using 2005.