Results 1 to 6 of 6

Thread: Trouble dropping a table!

  1. #1
    Join Date
    Oct 2002
    Posts
    123

    Trouble dropping a table!

    We had a weird problem yesterday. There is this particular table with only about 6000 rows. If I double click on the table in EM – it shows me the total no of rows, but if I do a select count(*) from dbo.teacher, the query would keep running for. I tried to export the data to a text file, & the process would go into sleeping forever! It would not let me drop the table either. I tried doing a Truncate – that process hanged also. What could have been the problem? I could open the table in EM & look at the data, but just any queries to it from QA or the application would hang forever. Finally I had to drop the table from sysobjects! I know that’s not the best way to drop a table, but this was an emergency!…What could I do or check for in such a situation if it happens again?? Thanks in advance !

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Check with sp_who2 to see if it's blocked by other process.

  3. #3
    Join Date
    Oct 2002
    Posts
    123
    well, i did run sp_who2 & there were no blocked processes.
    Is there any way of finding out what activity is going on with a particualar table??

    Thanks!

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    You can trace it with profiler.

  5. #5
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    try doing this

    select count(*) from dbo.teacher (nolock)

    if you can see all the data it means the table has been locked by some open connection.
    if it is not production server recycle the sql server service.

  6. #6
    Join Date
    Oct 2002
    Posts
    123
    hmm.. okay guys - thanks! i hope I dont run into this prob again - but if i do, at least i know where/what to start checking...
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •