Table creation

  • How can i check in a database that a table is created by which user?

    is their some query to know that which table was created by which user

    NEVER NEVER EVER GIVE UP;-)

  • Hi!

    I don't think you can find out without using triggers.

    __________________________
    Allzu viel ist ungesund...

  • It'll be in the default trace if it was recent enough, otherwise no way without having had a DDL trigger present at time of creation.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • My question is somewhat related to the original question...

    Whether the database owner is the database creator as well? I mean is there any way to find out who created a specific database? I've checked a few dbs of mine and the owner is ALPHA\USER1. Does this mean that that specific NT user created the DB? Thank you and I'm sorry if this is a dumb question. 😛

    __________________________
    Allzu viel ist ungesund...

  • No creater and owner isn't the same thing. You can chose the owner of db when created them.

  • Thanks for your time and response.

    I came across this though it applies to 2K:

    http://msdn.microsoft.com/en-us/library/aa258257%28v=sql.80%29.aspx

    "Each database has an owner who has the ability to perform special activities in the database. The owner is the user who creates the database. The database owner can be changed with sp_changedbowner."

    So basically the creator becomes the owner by default. Correct?

    __________________________
    Allzu viel ist ungesund...

  • Yes. I prefer to set it to sa. If the account that owns the database goes away, funny things happen.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (2/1/2011)


    Yes. I prefer to set it to sa. If the account that owns the database goes away, funny things happen.

    sa need mixed mode ?

  • No. The login exists even in windows authen. It just can't be used unless mixed mode enabled

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 9 posts - 1 through 8 (of 8 total)

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