Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 29th, 2004, 03:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default Finding the Owner

Hey,

I want to research who put a table into a database well after the fact (created 2003). Does SQL Server store that metadata somewhere?

Thanks,

Brian
__________________
Brian
 
Old July 29th, 2004, 03:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Oh, and this question assumes that auditing is off...
 
Old July 30th, 2004, 02:15 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

sp_help tablename

Ahmed Ali
Software Developer
 
Old July 30th, 2004, 08:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by alyeng2000
 sp_help tablename

Ahmed Ali
Software Developer
Of course, this merely lists the table's owner, e.g. 'dbo' and not at all necessarily the user that created it.

But I don't think you are going to do any better than this - I don't think the system keeps the sort of information you are looking for...

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old July 31st, 2004, 08:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Brian,

This gives you the Owner of the object.
Code:
select Sysusers.Name 
from Sysusers, Sysobjects 
where Id=object_id('<TABLE_NAME>') 
    and Sysobjects.Uid = Sysusers.Uid
    As Jeff said, one cannot go beyond that to find who really created it.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old August 3rd, 2004, 08:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

OK, thanks for the information.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change File Owner using .NET 1.1 bhuvanagiri .NET Framework 1.x 0 January 24th, 2008 05:09 AM
create owner skin angelboy C# 2005 2 July 6th, 2007 02:19 AM
Chp.12 SqlDataSourceView 'owner' property studen77 BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 0 March 6th, 2007 02:58 PM
how to change owner instead of DBO beetle_jaipur SQL Server 2000 1 April 6th, 2006 08:44 AM
Owner name before function sunil menghani SQL Server 2000 2 April 10th, 2005 02:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.