In our database I have a table table1 which has unique id's with about 11Million records. I have another table table 2 with 2Million records with an id column. I am trying to delete all rows in table 1 that exists in table 2.
Here is my query
delete s
from table1 S
where exists (SELECT m.id FROM table2 m WITH(NOLOCK) where m.id= s.id)
go
After I run the query, for some reason I still see some records in table 1 which exists in table 2. This happens i guess randomly. And this query runs every day in my application. So I am trying to understand why this is happening. There are no null values in my tables.
Please help.
Thanks in advance
CodezillatxtPost_CommentEmoticon(':hehe:');