I have follwoing data in MyTable
ID = 1, No1 = 23, No2 = 45, D = 1
ID = 2, No1 = 12, No2 = 5, D = 1
ID = 3, No1 = 14, No2 = 4, D = 1
ID = 4, No1 = 41, No2 = 12, D = 1
ID = 5, No1 = 2, No2 = 25, D = 1
ID = 6, No1 = 3, No2 = 96, D = 1
I want to update only first character of column No1 if it is 1 then it should be 0 as following
ID = 1, No1 = 23, No2 = 45, D = 1
ID = 2, No1 = 02, No2 = 5, D = 1
ID = 3, No1 = 04, No2 = 4, D = 1
ID = 4, No1 = 41, No2 = 12, D = 1
ID = 5, No1 = 2, No2 = 25, D = 1
ID = 6, No1 = 3, No2 = 96, D = 1
Now I am using C# to do this, I Open all records of No1
From MyTable
and checking in C# manually using loop
if I found first character as 1 then I make string and update database .. and it is working but problem is I have 10000 X 100
Records in Mytable
so every time loop will run 10000 X 100 times and result is application low performance,
I just want to ask is "there is any method to update Only fist character of a No1
coloumn by using only SQL and with C#...
Update : All datatypes of MyTable are int