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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change SQL 2005 Schema Owner 1

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
I need to change the owner of an SQL 2005 schema.

I can change it by selecting right clicking the schema properties within tyhe security/schema tree but I'd like to be able to do it in T-SQL.

I expected ALTER SCHEMA MySchema AUTHORIZATION MyNewUser;
to work but it appears not to be valid syntax.





Dazed and confused
 
This is what you are looking for.
Code:
ALTER AUTHORIZATION ON SCHEMA::[YourSchema] TO NewDBUser

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top