Monday, March 26, 2012

Replace the First Character

Hi All,
My query is
Select ID, ProdName from Product
I would like to replace the first character from ProdName (in every row)
with *.
Please let me know how to do it.
Thanks.SELECT ID, '*'+SUBSTRING(ProdName,2,8000) as ProdName FROM Product
Razvan|||On Sun, 18 Sep 2005 02:22:26 -0700, msnews wrote:

>Hi All,
>My query is
>Select ID, ProdName from Product
>I would like to replace the first character from ProdName (in every row)
>with *.
>Please let me know how to do it.
>Thanks.
>
Hi msnews,
Here's another way:
SELECT ID, STUFF(ProdName, 1, 1, '*') FROM Product
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

No comments:

Post a Comment