DELETE FROM table get stuck in SQL Server CE

415 Views Asked by At

I have a Compact Framework application where I run this code:

SqlCeCommand cmd = new SqlCeCommand();
cmd.Connection = conn;

cmd.CommandText = "DELETE FROM Empresa";
cmd.ExecuteNonQuery();

The Empresa table has only 187 records, but that instruction runs for over 4 minutes, which is abnormal.

Is there a way to optimize it? This table only has 2 columns. One of them is the identity. If I try adding WHERE id > 0 to the query, the same happens.

Thanks Jaime

0

There are 0 best solutions below