468,309 Members | 1,121 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,309 developers. It's quick & easy.

How to change db owner for SQL Server 2000 database

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
5 90634
ramasp
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
or from enterprise manager,right click on users and from opened users adjust ur adjustments
good luck
Sep 11 '06 #3
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
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
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

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by mplpost | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.