Why do scripts not put owner create statements for sprocs?

mdp2176mdp2176 Posts: 10
edited April 13, 2005 4:40PM in SQL Compare Previous Versions
I've read all the posts on comparing objects with different owners, and that is fine. But how come the resulting SQL from SQLCompare does not put the object owner in the create statement for stored procedures? It does it for tables, but not stored procedures.

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hello,

    The ownership given to a stored procedure depends on the creation SQL. If the script for the stored procedure (by double-clicking in in Enterprise Manager, etc) looks like:

    CREATE PROCEDURE MyProc...

    ...then the Stored Procedure will inherit the ownership of the user who ran the migration script produced by SQL Compare, regardless of the ownership reported by SQL Server through Enterprise Manager or Query Analyzer. If the script for the stored procedure looks like this:

    CREATE PROCEDURE dbo.MyProc...

    ...then the ownership would be dbo, assuming you're logged in under a dbo role, of course.

    This is the way that the software works currently. We'll look into better ways of handling ownership in the future.
This discussion has been closed.