What are the challenges you face when working across database platforms? Take the survey

Forcing owner (dbo)

sevdersevder Posts: 3
edited October 24, 2006 12:06PM in SQL Compare Previous Versions

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]'

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.


  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1

    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.
  • Options

    What about SQL 2005? I am using 2005.
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I don't know of a way to do this in SQL 2005, either. Unless someone else does?
Sign In or Register to comment.