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

SQL Server 2005 table not dropping

Status
Not open for further replies.

rmjohnson

MIS
Sep 26, 2007
2
US
I have been trying to drop a table for a while but it will not drop. It is not a large table. The command I used is:

drop table tablename

I also tried truncating the table:

truncate table tablename

Both appear to be running but never complete. I have started deleting records in groups but that is taking a long time too. Can anyone tell me how to get this table dropped or find out what the issue is so I can fix it?
 
have you tried to truncate the table first? That will remove all the data then try your drop.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Sounds like there are other transactions which are locking the table. Are you sure that there are no transactions which are accessing the table?

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
I did try to truncate first but after 3 hours of waiting I stopped it and tried to drop the table. All in all, I finally rebooted the server and was then able to drop the table. Go figure. Thanks for reponding.
 
Sounds like the table was in use when you tried to drop it. You should make sure that no one is getting errors now that the table is gone.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top