Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 how to display the objects of a particular owner

Author  Topic 

DURGESH
Posting Yak Master

105 Posts

Posted - 2008-06-05 : 00:49:51
hi all,
i have a question?
i have two owner 1.dbo and 2.durgesh
i wanna change the objects owned by dbo to durgesh
how to display the objects of a particular database owner
the following sql statements displays only tables and views object
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo'
but i need all objects(procedures,functions,triggers etc)

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-05 : 01:42:19
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'YourOwnerName'
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2008-06-05 : 02:53:41
For how to display the objects of a particular database owner


SELECT * FROM sysobjects WHERE xtype IN ('U','TR','P','FN') AND uid = (select uid FROM sysusers WHERE name='durgesh')

For : i wanna change the objects owned by dbo to durgesh


sp_changeobjectowner [ @objname = ] 'object' , [ @newowner = ] 'owner'

Go to Top of Page

DURGESH
Posting Yak Master

105 Posts

Posted - 2008-06-05 : 03:02:35
HI ALL
HERE IS THE ANSWER FOR STORED PROCEDURE AND FUNCTIONS

select routine_name from information_schema.routines where routine_schema='YOUR OWNER NAME'
Go to Top of Page
   

- Advertisement -