Jamie Alford
Jamie Alford

Reputation: 95

querying nvarchar fields in a table pauses part way through

I have a problem with one of the tables in my database. If I do a select * from table, the query will grab the first hundred or so records in under a second, pause for a few seconds, grab the next 600 or so and then not go any further (the query keeps processing but no more records are fetched. It consistently stops after record 718 - even if I let it run for more than 10 minutes.

Notes:

I'm assuming that there is some kind of corruption going on but DBCC CHECKDB(MyDB) WITH NO_INFOMSGS isn't reporting anything.

Upvotes: 0

Views: 26

Answers (1)

Jamie Alford
Jamie Alford

Reputation: 95

The problem was caused by a record lock on the table - in another SSMS window I had another uncommitted transaction that was locking the record. Once that was committed the queries worked successfully.

Credit to Brad D for setting me on the right path.

FYI: exec sp_who; exec sp_who2 or exec sp_lock would have identified the wayward process.

Upvotes: 1

Related Questions