0

I have a SQL Server 2005 SP3 box that one of my developers created a temp table on that we cannot seem to remove because it somehow got brackets in the name of the table?

SELECT Name, object_id FROM sys.objects WHERE Name LIKE '%#example%'
Results:
Name        object_id
[#example]  123828384 

Anyone know how we can get rid of this? Thanks!

rkthkr
  • 8,618
  • 28
  • 38
David Mathis
  • 898
  • 2
  • 9
  • 21

2 Answers2

1

THe table wasn't showing up in SMS 2005, so I used SMS 2008 and ran as Administrator, and then I was able to remove the table via the GUI.

David Mathis
  • 898
  • 2
  • 9
  • 21
0

Just wrap the whole name with square brackets.

e.g.

drop table [[#example]

Should do it I think

Chris W
  • 2,670
  • 1
  • 23
  • 32