Stored proc owned by "Domain\username" instead of "dbo"

  • Our developers are "dbo" of the development databses they work on. One dev created a stored proc, with schama "dbo', and copied it to another sql server where it appeared with schema (domain name\hisusername). What causes this? He belongs to the dbo_owner role on both servers.

    Barkingdog

  • If he runs scripts to create procedures like this:

    CREATE PROCEDURE MyProc ...

    instead of like this

    CREATE PROCEDURE dbo.MyProc ...

    --or

    CREATE PROCEDURE myschema.MyProc ...

    You'll see what's occurring. It will create the procedure as being owned by that user. It's probably also creating a schema for that user. You'll want to clean that up as well after you fix the procs.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply