WHILE @@ROWCOUNT <> 0
BEGIN
CHECKPOINT;
DELETE TOP (300000)
FROM [dbo].[Event] AS E
INNER JOIN #tempEvents AS TE
ON E.[EventID] = TE.[EventID]
END
For starters, I get:
Incorrect syntax near the keyword 'AS'.
So, I remove this and replace with the aliases with full table names, which gives me:
Incorrect syntax near the keyword 'INNER'.
I found this question which is where I found out about doing an INNER JOIN, but SQL Server isn’t parsing this correctly. Any ideas?
try this:
you missed the tablename/alias after the top statement.