SQL Command Assistance Needed

I have a SQL 2000 database named office
I have a table in this database named leavecertify
I need to give schema ownership of everythiing in the leavecertify table to DB
What is the sql command to do this? I can't find out how to do this is the GUI. Thanks
LVL 15
wantabe2Asked:
Who is Participating?
 
knightEknightConnect With a Mentor Commented:
oops, forgot the quotes:
  exec sp_changeobjectowner 'user1.leavecertify', 'dbo'


See also:
  exec sp_help sp_changeobjectowner
0
 
knightEknightCommented:
What is DB?  A user?  Another database?

Not sure if this will work in 2000, but if "DB" is a schema this works in 2008:

ALTER AUTHORIZATION on [dbo].[leavecertify] to [DB]
0
 
wantabe2Author Commented:
I meant to say dbo

will that work?
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
wantabe2Author Commented:
I get an

"Incorrect syntax near the keyword 'AUTHORIZATION'

when I run ALTER AUTHORIZATION on [dbo].[leavecertify] to [DBO]


Any other suggestions?
0
 
wantabe2Author Commented:
Please excuse my ignorance but I'm not that familair with SQL quueries...

Do I run that in the SQL Query Analyzer? Or something else?
0
 
knightEknightCommented:
Actually, this shows my ignorance of SQL 2000.  :)   It looks like ALTER AUTHORIZATION doesn't work in 2000 the way it does in 2008.  Besides, if the table is already owned by dbo, then altering it to dbo (instead of "DB") wouldn't change anything anyway.
0
 
wantabe2Author Commented:
The leave certify table is currently owned by user1
I just need to take ownership away from user1 & give it to dbo
Is there any other way to do this on SQL 2000 other than the GUI?
0
 
knightEknightCommented:
oooh, in that case try:

exec sp_changeobjectowner user1.leavecertify, dbo
0
All Courses

From novice to tech pro — start learning today.