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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Single Quotes around Table Name...

Status
Not open for further replies.

scan2k

MIS
Apr 1, 2003
20
0
0
US
I created a table named 'XYZ' and now I can't drop the table. I mistakenly included the single quotes in my create table statement. How do I DROP a table with single quotes around it? Thanks for your help....!!!
 
Try:

DROP TABLE ''XYZ''

Note that those are all single quotes.

-SQLBill
 
You could also drop it through Enterprise Manager.

-SQLBill
 
Thanks for your response but this does not work. I tried single and double quotes before and after the table name and I cannot get the table to DROP. Help Help!!!
 
Also, cannot drop using Enterprise Manager...it gives an error. Error near 'xyz'
 
Try putting square brackets around the table name:

drop table ['xyz']

Tim
 
This is SQL 6.5 does this matter? The ['xyz'] method is not working...it yields a syntax error. Still puzzled....
 
Can you post your DROP Table code to see if we can see an issue w/ the syntax?

Thanks

J. Kusch
 
Well if all else fails and you're a brave sole, then try going into the sysobjects table and manually change the name of the table. Then try to drop it using the new name. If that doesn't work I'd change the name back to what it was originally in the sysobjects table.
-Karl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top