364,111 Members | 2044 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

How to change db owner for SQL Server 2000 database

papayaya
P: 1
Our programmer has left the company and the tables and views were created with his credential as owner.
How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowner?
Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?
Aug 28 '06 #1
Share this Question
Share on Google+
5 Replies


ramasp
P: 19
select * from sysobjects where xtype='u'

The above command displays user tables. Get each user table name from sysobjects by using cursor or while loop pass the same as input parameter ot the sp_changedbowner

Try .....
Sep 4 '06 #2

mishibala
P: 8
or from enterprise manager,right click on users and from opened users adjust ur adjustments
good luck
Sep 11 '06 #3

Abdul Haque
P: 17
Our programmer has left the company and the tables and views were created with his credential as owner.
How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowner?
Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?

hi dude have a look at this link http://support.microsoft.com/kb/275312
Jun 13 '07 #4

jstone
P: 1
use [currentdatabase]
go
sp_changedbowner 'yourusername', 'true'
go

This will change the owner of the current database to whatever username you want ( you could put sa in there ) and then remap any alias as well (that's the true).

// John Stone

Our programmer has left the company and the tables and views were created with his credential as owner.
How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowner?
Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?
Jun 25 '07 #5

shrimant
P: 48
In SQL Server Management Studio 2005:
1/ Right Click on the Database node
2/Click Properties
3/Select Files
4/There would be a Owner Text Box, change the new Owner Name or browse and select the new Owner.

Shrimant Patel
&
Harith Patel
Sep 26 '07 #6

Post your reply

Help answer this question



Didn't find the answer to your Microsoft SQL Server question?

You can also browse similar questions: Microsoft SQL Server changedbowner dbowner sql changedbowner