Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dbo.dbo. sp_rename error

Status
Not open for further replies.

fredong

IS-IT--Management
Sep 19, 2001
332
US
Hi,
I accidentally rename dbo.AA table to dbo.AA_1 and now it has become dbo.dbo.AA_1 table. Is there a way to remove the dbo prefix? Please advise. Thanks.
 
Rename the table again? Change it to just AA_1. Leave off the dbo when you rename it.

OR...create a new table AA_1. Copy the data (SELECT INTO) from the bad table to the new one, then drop the old table.

-SQLBill

Posting advice: FAQ481-4875
 
I tried this statement and it returned 'invalid object name dbo.dbo.AA'


select * into dbo.AA_1 from dbo.dbo.AA

it seemed like the dbo.dbo. cannot be recognized by the system.
 
Normally, you cannot have a table name with a dot in it. Of course, you can actually name your tables anything you want if you use square brackets, like this...

select * into dbo.AA_1 from dbo.[!][[/!]dbo.AA[!]][/!]




-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Hi gmmastros

Thanks for your help. It works.
 
You do know that Select Into will only copy the data, don't you? The new table will not have the same indexes or constraints as the original table. There are probably other things that don't get copied to the new table too.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thanks for letting me know. I have not build queries for those table yet and I probably index it later.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top