|
I have a column in my database table like the column name is ID. In this column 14th digit number of students are insert. But I want to replace a digit like from '01470526100201' number I want to replace the 12th no. digit '2' into '3'.How I can do it.
(comments are locked)
|
|
SUBSTRING-function should be your friend here. But keep in mind that the above query won't be able to make any good use of indexes, since the WHERE-clause uses a function on the index. And since you are interested in the value of the 12th digit in a a string, no other comparison method will be able to make use of indexes either. I'm guessing your table has ID as a clustered primary key, and then the above query will result in a table scan. For a small table, that might not cause too much pain, with a large table, your server will be kept quite busy scanning the table and moving pages in and out of memory. It's work.Thank you for your answer.
Oct 16 '12 at 05:57 AM
Farzana
(comments are locked)
|

