SQL Server: change table owner

Sometimes I found some tables whose owner is some user … but dbo!
Well, don’t ask me why … (you know … people! 😉 )

Store procedure sp_changeobjectowner is what I need to set the right owner.
I found usefull info, about tables and SPs here: Change schema name on Tables and Stored procedures in SQL Server 2005

Here is an example of sql statement:

sp_changeobjectowner ‘[myUser].[myTable]’, ‘dbo’
go

source:Change schema name on Tables and Stored procedures in SQL Server 2005
more info here: MSDN sp_changeobjectowner

Technorati tags: SQL Server, sp_changeobjectowner
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: