Suresh
It seems that I did not understand your requirements
Here is another one written by Itzik Ben-Gan
CREATE FUNCTION dbo.fn_capitalize
(
@str AS nvarchar(100)
)
RETURNS nvarchar(100)
AS
BEGIN
DECLARE
@ret_str AS varchar(100),
@pos AS int,
@len AS int
SELECT
@ret_str = N' ' + LOWER(@str),
@pos = 1,
@len = LEN(@str) + 1
WHILE @pos > 0 AND @pos < @len
BEGIN
SET @ret_str = STUFF(@ret_str,
@pos + 1,
1,
UPPER(SUBSTRING(@ret_str,@pos + 1, 1)))
SET @pos = CHARINDEX(N' ', @ret_str, @pos + 1)
END
RETURN RIGHT(@ret_str, @len - 1)
END
[quoted text, click to view] "Uri Dimant" <urid@iscar.co.il> wrote in message
news:OIlMJPe1EHA.1296@TK2MSFTNGP10.phx.gbl...
> Suresh
> There are some examples
> create table ABCD
> (
> [id]smallint not null,
> description varchar(20) null
> )
> insert into ABCD([id],description)values (1,'DFh2AcZ')
> insert into ABCD([id],description)values (2,'dHZ3')
>
> )
>
> SELECT description FROM ABCD where charindex(cast('H' as
> varbinary(20)),cast(description as varbinary(20)))> 0
>
> SELECT description
> FROM ABCD
> WHERE description ='dhZ3'COLLATE Latin1_General_BIN
>
> SELECT description
> FROM ABCD
> WHERE charindex('h',description COLLATE Latin1_General_BIN)>0
>
>
>
>
>
> "Suresh" <Suresh@discussions.microsoft.com> wrote in message
> news:AA1AC827-DA0D-421E-9118-662848C0AB7C@microsoft.com...
> > I need to retrive the a case sensitive value from a string.
> > like select All_Capital_Alphebets("This Is My String")
> > Expected result : "TIMS" (ie all capital letters from the string.
> >
> > How can i achieve this.
> >
> > Thanks in advance
> >
> > Suresh
>
>