Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Using with (NOLOCK) and rows per batch?

$
0
0

I have a package that has something like this in an OLE DB Source  task:

select HEIGHT from dbo.PEOPLE [P] left join dbo.CURRENTHEIGHT [C] on [P].[ID] = [C].[ID] where [C].[HEIGHT] <> [P].[HEIGHT];

I then have an OLE DB Destination task that just inserts the results of that into dbo.[CURRENTHEIGHT].  On this task, my batch size is set to 100k and "maximum insert commit size" is set to 100k.  I have Table Lock and Check Constraints turned on (checked).

If dbo.PEOPLE has > 100k records, my package locks.  So, I added with (nolock) to the left join and everything seems to work fine.

What I am wondering though, is since I am reading from and inserting into dbo.CURRENTHEIGHT, will the select statement be able to pull back rows that were newly inserted?

I am not sure how SSIS chunks things into 100k rows and reads them during the OLE DB Source task so I am not sure if with NOLOCK will cause issues in this case as I do not want to read the newly inserted rows.

Hopefully that all makes sense.



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>