Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Determine Which Objects User Owns 1

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
Hi,

If user abc has created some objects, how can I determine those object names? I know there's a system stored proc, but I cant find it.

thanks, john
 
I don't know the procedure your talking about but you this will give you a list of objects within a DB that a user owns.

Code:
select 
u.Name as 'User',
o.Name as 'Object 
from sysobjects o
	JOIN sysusers u ON u.uid = o.uid
where u.Name = 'dbo'

"Shoot Me! Shoot Me NOW!!!"
- Daffy Duck
 
Add to the where clause, AND o.xtype = 'u'
So it should look like this...

SELECT u.Name as "User", o.Name as "Object "
FROM sysobjects o
JOIN sysusers u ON u.uid = o.uid
WHERE u.Name = 'dbo'
AND o.xtype = 'u'
 
wow MDXer,

That's exactly what I needed. Maybe there is not a sys sp. I never found one that does this.

thanks, John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top