Table Ownership

  • Our test and productions servers are both SQL Server 2000 and both contain the "MyDatabase" database.  Using the same login, on each server, I run the following:

    use MyDatabase

    select top 10 * 

    into RNPGifts

    from gifts

    On the production system, the resulting table, RNPGifts is owned by my login.  On the test system, the table is owned by dbo.

    What do I look for to explain the difference?  I want the test system to behave like production.

  • Want everything to be consistant? Allways preface your objects with their owner, both on create and select/exec.

    CREATE PROC dbo.MyStoredProc

    CREATE TABLE dbo.MyTable

    EXEC dbo.MyStoredProc

    SELECT * FROM dbo.MyTable

    Check to make sure that your database owner is SA and not some other individual.


    Julian Kuiters
    juliankuiters.id.au

  • From the BOL entry on 'dbo', "any object created by any member of the sysadmin fixed server role belongs to dbo automatically". I would suggest that your connection to your test server is as a member of sysadmin. This is a good candidate for something that might be true on a test server but not on production.

     

     

  • Yes, my login was assigned to the System Administrators server role on the test server.  That was the difference.

    Thanks.

Viewing 4 posts - 1 through 3 (of 3 total)

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