I've a large (1TB) table in SQL Server 2008 that looks something like this:
ID int | Flag BIT | Notes NTEXT
I need to search every row and set the Flag
bit to 1 where Notes contains the word flip
Is
UPDATE Table SET Flag = 1
WHERE Notes LIKE '%flip%'
the 'best' way to do it?
I'm thinking that this could take days to run on such a large table. I have tried running a
SELECT TOP (10) * FROM Table
WHERE Notes LIKE '%flip%'
and it is still running after 10 minutes - so performance isn't looking good.
Would creating a C# app to read/update each row be a better method. At least I could then do the change in bits without locking up the table for days.
Are there any other methods I should consider?