Hi,
I was trying to drop a table (or alter it in any way) and the Managment Studio Express gave me an error of timeout. So I say something like DROP TABLE myTable, and it takes a while and gives me the error. Does anybody know how to unlock a table?
Thanks
Hi Alessandro,
As this is Express, I'm guessing that a stopping and restarting the SQL Server service sin't going to impact usage? If not, do this and re-issue your drop command, you'll probably that an application is placing a lock on the table in question and blocking the ddl command.
There are other ways to identify the offending session (spid), but this is probably easiest in your case.
Cheers,
Rob
|||post back the actual error u gets...
Madhu
|||Hi
Possible to post the error message to further explore your problem?
At the mean time:
1. Check whether the table really exists in the correct database. Do the folowing:
Select Name from Sys.Objects where name='tablename' -- (if exist)
Drop table databasename.schema.tablename
2. Check that the Login that you are using to execute this query has the approriate permission. You can do so by verify the user properties in the security node.
3. Check whether the table has any reference to other tables
4. Verify whether the table is locked using the current activity. If necessary, you can end the lock by killing the session.
No comments:
Post a Comment