how to add new character in existing values?

Last Post 24 Feb 2005 06:37 AM by nosepicker. 1 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
New Member
New Member

23 Feb 2005 08:30 PM
How can i use sql statement to add additional character in existing values, I want the first character to be replaced with new character..
example: 123456 contains 6 char so I want replace it by 223456 also contains 6 char
New Member
New Member

24 Feb 2005 06:37 AM
If you know that you always want to replace a specific character with another specific character (like if you always want to replace the number 1 with the number 2), then you can use REPLACE. Even though I can't tell for sure what rules you want to use for replacing your text, it seems like the STUFF function will work better for you. The STUFF function allows you to replace characters based on their character position within the string. So if you want to replace the first character of a string with something else, regardless of what is in that first position, then use STUFF. If your substitution rules are more complicated than that, you might have to use a combination of functions.

Acceptable Use Policy