Saturday, February 25, 2012

change table ownership 2005

I have never been able to get this to work for 2005. Can anyone help
me troubleshoot my problem? I run this:
ALTER AUTHORIZATION ON db.table TO dbo;
GO
And get incorrect syntax near the keyword 'authorization'
I am supposed to run it as a query right?
That's the correct syntax, yes. Does the following script run without error
for you:
use tempdb
go
create user auser without login
go
create table xyz (xxyyzz int)
go
alter authorization on xyz to auser
go
drop table xyz
go
drop user auser
go
--
Adam Machanic
SQL Server MVP
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
<glayla@.gmail.com> wrote in message
news:1182458122.375047.227480@.k79g2000hse.googlegr oups.com...
>I have never been able to get this to work for 2005. Can anyone help
> me troubleshoot my problem? I run this:
> ALTER AUTHORIZATION ON db.table TO dbo;
> GO
> And get incorrect syntax near the keyword 'authorization'
> I am supposed to run it as a query right?
>

No comments:

Post a Comment