We help IT Professionals succeed at work.

insert records to local sql instance hanging

johnnyg123
johnnyg123 asked
on
I have installed a local instance of sql 2014

just trying to do an insert of 76700 records to a table

it has been running 20 minutes now

I did in sp_who2  do not see any blocks

if I do a  select count(id) from name with (nolock)  it shows 76700   yet the query is still running

I'm confused

are there some settings I should be looking at ?
Comment
Watch Question

ste5anSenior Developer
CERTIFIED EXPERT

Commented:
Well, do you read the rows (not records) from a view or a table? How long does your test query runs without the NOLOCK hint? Open perfmon and take a look at the disk IO. Also open the Activity Monitor in SSMS to see wait is happening live.
Database Administrator / Software Engineer
CERTIFIED EXPERT
Commented:
Hi,

First check if there exist any locks on the table that are deadlocking with your insert.
https://www.wearediagram.com/blog/sql-server-locks-blocked-processes-and-two-easy-ways-to-find-them
https://www.mssqltips.com/sqlservertip/2732/different-techniques-to-identify-blocking-in-sql-server/

Do you run commit after the insert or have you autocommit turned on ?
If you are inserting the same amount of data that your dirty read query shows then I suspect that you either need to issue commit or there
exist some locks on your tables that are deadlocking with the insert or some system tables.

Regards,
    Tomas Helgi

Explore More ContentExplore courses, solutions, and other research materials related to this topic.