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 2005 Forums
 SQL Server Administration (2005)
 Change Table/SP owner

Author  Topic 

dbaman
Starting Member

46 Posts

Posted - 2009-02-17 : 14:06:37
I have Database on SQLServer2005 box. The current owner of the objects and stored procedure is DBO. I want to change the owner to lets say devteam1. devteam1 is a user in the database with db_datareader db_datawriter db_ddladmin permission.

However when I run the script

USE DBNAME
Exec sp_changeobjectowner 'emp Information', 'devteam1';
go

I am getting the error message:

Msg 15411, Level 11, State 1, Procedure sp_changeobjectowner, Line 107
Database principal or schema 'devteam1' does not exist in this database.


What I am doing wrong?

Thanks for all the help.

R

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-17 : 14:09:24
Create devteam1 as a schema.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

dbaman
Starting Member

46 Posts

Posted - 2009-02-17 : 14:25:48
quote:
Originally posted by tkizer

Create devteam1 as a schema.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog




Thanks for your reply. How Can I Create devteam1 as a schema ?

R
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-17 : 14:31:40
You can do it through the GUI or via T-SQL CREATE SCHEMA command. Check Books Online for details.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -