Question

i have a table which contains 10000 records, now i have added the field for placing the plaintext password, so now i want to update all the records, but should update the new field on the basis of the username... like below.

update users set secdetail = case when username = 'abbas' then 'abbas@123' .... end

i am running this query from .net code, using sqlcommand, whenever i try to refresh the pagem after loading for sometime, i gets a message saying,

The query processor ran out of stack space during query optimization. Please simplify the query

Please help.

Was it helpful?

Solution

Why not create a loop in your .net code to produce proper sql update statements separated by semicolins

Update Users Set Secdetail = 'abbas@123' Where Username = 'abbas';
Update Users Set Secdetail = 'bbbas@123' Where Username = 'bbbas';
Update Users Set Secdetail = 'cbbas@123' Where Username = 'cbbas';
...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top