December 11, 2006 at 7:12 pm
Hi all,
I've spent the last half hour looking thru the internet trying to figure why I can't change 3 tables owned by some other user to dbo.
I'm been using: exec sp_changeobjectowner @objname = 'Win03\firstName.LastName.ARCMonth', @newowner = 'dbo'
I get an error coming back to me: object '[Win03\firstName.LastName.ARCMonth]' does not exist or is not valid object for this operation
I've also tried: exec sp_changeobjectowner @objname = [Win03\firstName.LastName.ARCMonth], @newowner = 'dbo'
and
exec sp_changeobjectowner @objname = '[Win03\firstName.LastName.ARCMonth]', @newowner = 'dbo'
same result. Anythoughts?
O yeah, I have stripped her db_owner ship permission as of tonight, if some of you are wondering.
Thanks.
-----------------------------
www.cbtr.net
.: SQL Backup Admin Tool[/url] :.
December 11, 2006 at 8:42 pm
December 11, 2006 at 9:07 pm
Try
exec sp_changeobjectowner @objname = '[Win03\firstName.LastName].[ARCMonth]', @newowner = 'dbo'
You need to use square brackets to delimit he part of the name of the object. In your example, you are specifying the owner and the table name.
By default, SQL Server uses the full stop to implicitly delimit each part of the name. Hence, it was thinking that the table name was "Win03\firstName.LastName.ARCMonth" and, implicitly, that it was owned by the user running the command.
Using the square brackets tells SQL explicitly which part of the string is the owner and which is the table name.
December 12, 2006 at 2:11 am
Thanks to both of you!
-----------------------------
www.cbtr.net
.: SQL Backup Admin Tool[/url] :.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply