-1

I have the following table design

Table

When trying to execute the below query, it never completes (Execution time 5 minutes and counting)

insert into tableName
(column1, column2, column3)
values ('1000184', '927', '<values>a</values>')

Screenshot: Timeout

What could be the reason of this? This is a very simple SQL insert query...

Additional information:

  • Local Hyper-V machine
  • Windows server 2012 R2 (evalutaion period)
  • SQL Server 2012
Ozkan
  • 3,880
  • 9
  • 47
  • 78

3 Answers3

0

I had a similar problem before. In my situation, there was a trigger getting fired with my insert query and it was blocking SQL Server to complete my insert query. To see that, you should run the insert query and also run the command EXEC SP_WHO2, which shows all running processes, in another window in the server. Check the attribute BLK there to observe the blocked processes.

Eray Balkanli
  • 7,752
  • 11
  • 48
  • 82
0

Removing and Adding the table again has solved my problem. Probably a lock as Alex K. mentioned

Ozkan
  • 3,880
  • 9
  • 47
  • 78
-1
INSERT INTO tableName (column1, column2, column3)
VALUES('1000184', '927', '<values>a</values>')

Make sure you use correct capitalization when writing a query. Also, check your data types.

For example, 1000184 and 927 do not need to be wrapped with quotations if they are declared as numeric value.

I hope this helps!

Jaydip Jadhav
  • 12,179
  • 6
  • 24
  • 40
  • SQL is case **in**-sensitive `insert` is exactly the same thing as `INSERT` –  Apr 12 '16 at 16:37