• Do you only have those characters at the end of your string? you could simply use REPLACE or if you just want to eliminate the last ones, there's a more complex approach.

    Here are some examples:

    DECLARE @String char(9), @Final varchar(9)

    SELECT @String = 'asdf'

    SELECT @Final = @String

    PRINT @Final + @String

    SELECT @Final = LEFT( @String, 10/*Length + 1*/ - PATINDEX( '%[^]%', REVERSE(@String)))

    PRINT @Final + @String

    SELECT @Final = REPLACE(@String, CHAR(9), '')

    PRINT @Final + @String

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2