Link to home
Start Free TrialLog in
Avatar of wantabe2
wantabe2Flag for United States of America

asked on

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
Avatar of knightEknight
knightEknight
Flag of United States of America image

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]
Avatar of wantabe2

ASKER

I meant to say dbo

will that work?
I get an

"Incorrect syntax near the keyword 'AUTHORIZATION'

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


Any other suggestions?
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?
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.
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?
oooh, in that case try:

exec sp_changeobjectowner user1.leavecertify, dbo
ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial