Reputation: 457
I came around some weird thing in MS SQL server. I have two tables in my Database : "LogAnalyzer"
1> LogData
2> TestLogData
LogData contains around 9200192 rows and testLogdata around 1000 rows.
When I tried inserting a row in LogData it was taking like 10 minutes and still not inserting it .. It was just showing Executing Query
When I tried inserting a row in testLogData it did immediately.
Even when I connected the database through Java code it was behaving the same and I have properly closed the connection (I think)...
All worked fine after restarting the SQL server .. I dont know why this happened. As it was working all fine till now.
Please can anyone suggest the causes for this. I do not think its the size of the table because it worked fine after restart. (Query inserted immediately).
Upvotes: 0
Views: 192
Reputation: 131
Please can anyone suggest the causes for this.
A possible cause is that your connection is being blocked by another connection which has a transaction open on the table that the blocked connection is trying to access.
Now that SQL Server has been restarted you can't perform any diagnostics to find the cause but if it happens again then you could run sp_who2 to see a list of connections and check the BlkBy column to see if your connection is blocked. If your connection is blocked then you can get the SPID of the blocking process and use kill to terminate the blocking process.
Upvotes: 1