Note that there are some explanatory texts on larger screens.

plurals
  1. POTimeout on SQL Server Delete Command
    primarykey
    data
    text
    <p>I am using the following code:</p> <pre><code>'item being 14 mySQLdel = "DELETE FROM table WHERE ID= " &amp; item response.write "&lt;p&gt;SQL Command: " &amp; mySQLdel &amp; "&lt;/p&gt;" myConn.Execute(mySQLdel) </code></pre> <p>Whether the record with the id 14 exists or not, I am getting:</p> <blockquote> <p>DELETE FROM table WHERE ID=14</p> <p>Microsoft OLE DB Provider for SQL Server error '80040e31'</p> <p>Query timeout expired</p> <p>/index.asp, line 58</p> </blockquote> <p>Line 58 being:</p> <pre><code>myConn.Execute(mySQLdel) </code></pre> <p>The equivalent command is fine working on another table, so I assume that it is something to do with permissions, although can't for the life of me work out what.</p> <p>When I run the same SQL in SQL Management Studio, the query executes almost instantly.</p> <p>Here is the create script which was requested below:</p> <pre><code>USE [user1] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[tablename]( [id] [int] IDENTITY(1,1) NOT NULL, [var1] [nvarchar](max) NULL, [var2] [int] NULL, [var3] [int] NULL, [var4] [nvarchar](50) NULL, [datecreated] [datetime] NULL ) ON [PRIMARY] GO </code></pre> <p><code>sys.dm_os_waiting_tasks</code> shows</p> <pre><code>+----------------------+------------+-----------------+------------------+-----------+--------------------+-----------------------+---------------------+--------------------------+--------------------------------------------------------------------------------------------------+--+ | waiting_task_address | session_id | exec_context_id | wait_duration_ms | wait_type | resou‌​rce_address | blocking_task_address | blocking_session_id | blocking_exec_context_id | re‌​source_description | | +----------------------+------------+-----------------+------------------+-----------+--------------------+-----------------------+---------------------+--------------------------+--------------------------------------------------------------------------------------------------+--+ | 0x00000000041F7288 | 63 | 0 | 7139 | LCK_M_U | 0x00000000869F2C40 | NULL | 69 | NULL | ridlock fileid=1 pageid=214 dbid=61 id=lock847e0b00 mode=U associatedObjectId=72057594039435264 | | +----------------------+------------+-----------------+------------------+-----------+--------------------+-----------------------+---------------------+--------------------------+--------------------------------------------------------------------------------------------------+--+ </code></pre> <p>Any ideas?</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload