airbourne 29 Junior Poster

I know this is a beginner question, but my SQL experience is very limited so I'd like some clarification before I pull the trigger on this.

I have a SQL 2000 database who's owner has been deleted. From the looks of it, a long time ago. So now I cannot view the property page of the database because, as I understand it, the database owner is effectively orphaned. Here is the error:

Cannot show requested dialog. (SqlMgmt)

Property Owner is not available for Database '[dbname]'. This property may not exist for this object, or may not be retriveable due to insufficient access rights. (Microsoft.SqlServer.Smo)

So, doing some digging, i found this command (or a derivative of this command) on various websites:

USE dbname
EXEC sp_changedbowner 'sa'

I am using Windows Authentication to connect to the server and execute the command. I have all server roles as well as all database role memberships for that particular database assigned to my login.

I will be making a backup of the database before I execute any code (as always), I just wanted to make sure that the syntax above looks correct for the problem I am describing. Also, I just drop that into an Query window and click execute, correct?