Tag Info

New answers tagged

1

Note that regardless of whether you trigger a table lock, a 1000+ record INSERT transaction will lock many pages in your indexes, and has a high risk of causing deadlocking or other problems. The good news is that your post does not seem to provide a business case for taking on a such a large transactional operation. The data source table is not going ...


1

You might be getting lock escalation. This is when SQL Server replaces many fine-grained (row) locks with a single coarse-grained (table) lock to save system resources. This is most likely if you are processing many rows within a transaction. That link suggests some work-arounds.


1

The only correct answer here is "It Depends". There are so many factors that come into play that you will just have do many runs with different parameters try to find what are the optimal settings for your system, and you can also play with locking hints if your table has indexes that are optimal for the search condition. There are some rules of thumb.. if ...


0

There is the possibility that you are getting lock escalations onto the table level, or page locks on the clustered index page. A deadlock graph will show that, try starting a SQL Server trace grabbing just the Deadlock graphs from the server and check those You can also delete in batches which will improve concurrency and if the delete is handling large ...


0

Try something like this: -Install SQL 2012 feature pack to get invoke-sqlcmd or change it to use sqlcmd. -You can just pass in the raw TSQL but I would turn it into a stored procedure and just pass that in. Something like: CREATE PROCEDURE [GetDeleteDate] AS select ArquivoServidor from tblExchange where DATEDIFF(day,LogDownload,GETDATE())>= 7 or ...



Top 50 recent answers are included