Friday, March 23, 2012

Is it possible to determine which user created a table?

I've come across a table in one of my databases that I don't remember
creating. Is it possible to tell which user created this table?
Hello,
sp_help <tableName>
If the user create the table with DBO schema then the owner will be DBO and
it would be tough for you to identify the user who created the table.
Thanks
Hari
"Danielle" <wxbuff@.aol.com> wrote in message
news:1176065707.471519.177860@.p77g2000hsh.googlegr oups.com...
> I've come across a table in one of my databases that I don't remember
> creating. Is it possible to tell which user created this table?
>
|||Thanks Hari -
You were right... DBO is the owner. Not much to go on I'm afraid, but
that is a handy SP. Thanks for the tip.
Danielle
|||On Apr 9, 2:00 pm, "Danielle" <wxb...@.aol.com> wrote:
> Thanks Hari -
> You were right... DBO is the owner. Not much to go on I'm afraid, but
> that is a handy SP. Thanks for the tip.
> Danielle
If you are on SQL 2005 you can use DDL triggers. I do this to track
all schema changes. You can look in "DDL Triggers" in BOL. I know when
my developers change tables, procs, views, fields etc.
Kristina
|||On Apr 8, 4:55 pm, "Danielle" <wxb...@.aol.com> wrote:
> I've come across a table in one of my databases that I don't remember
> creating. Is it possible to tell which user created this table?
You can also use the information_schema.tables view
run this but change 'YourTableName' to the actual table name
select table_schema as ObjectOwner,table_name,*
from information_schema.tables
where table_name ='YourTableName'
Denis the SQL Menace
http://sqlservercode.blogspot.com/

No comments:

Post a Comment