Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Change Object Ownership Expand / Collapse
Author
Message
Posted Thursday, February 05, 2009 9:26 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 30, 2009 12:01 PM
Points: 2, Visits: 4
SQL Server 2005 newbie.

User created objects which, instead of dbo, are associated with his account. How can we change this?

Many thanks!
Post #651000
Posted Thursday, February 05, 2009 9:49 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, April 17, 2014 4:09 AM
Points: 335, Visits: 881
http://msdn.microsoft.com/en-us/library/ms173423.aspx
Post #651028
Posted Thursday, February 05, 2009 9:54 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 30, 2009 12:01 PM
Points: 2, Visits: 4
Yeah, after I asked the question on behalf of the developer, he figured it out himself. ;)
Post #651035
Posted Thursday, February 05, 2009 9:57 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, March 14, 2014 3:15 PM
Points: 804, Visits: 935
You might change the schema that owns the object as


ALTER SCHEMA schema_name TRANSFER object_name


Thanks!!


The_SQL_DBA
MCTS

"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
Post #651040
Posted Thursday, February 05, 2009 10:05 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Saturday, April 12, 2014 11:40 AM
Points: 2,795, Visits: 8,297
And if you have lots of them to change:

SELECT 'ALTER SCHEMA NewSchema TRANSFER ' + '['+TABLE_SCHEMA+']' + '.' + TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'OldSchema'
order by TABLE_NAME



Post #651049
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse