remove special character from column

I have a question.

There is a column named: Shipping Time, and it has a data type of varchar(32)
but when I run a select to see the values of this column, I see that the value is stored as:

sshot

I would like to learn if possible through asking this question,  how to convert, or replace that special character that I have not seen before.

For your help, thank you very much.
metropiaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
David L. HansenConnect With a Mentor Programmer AnalystCommented:
If so,
SUBSTRING(colName, 1, 1)
will do the job.
0
 
David L. HansenProgrammer AnalystCommented:
Will the returned good characters always be a single digit or could they be larger integers?
0
 
metropiaAuthor Commented:
the largest number would not pass the two digits
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
David L. HansenProgrammer AnalystCommented:
The the largest possible value would be 9?
0
 
David L. HansenProgrammer AnalystCommented:
Did that work?
0
 
Scott PletcherConnect With a Mentor Senior DBACommented:
To be safe, I suggest keeping all valid leading digits, and removing all characters after the last valid digit:


UPDATE dbo.tablename
SET [Shipping Time] = SUBSTRING([Shipping Time], PATINDEX('%[^0-9]%', [Shipping Time]) - 1, 100)
WHERE
    [Shipping Time] LIKE '%[^0-9]%'
0
 
rk_india1Connect With a Mentor Commented:
If you have multiple special character the use the following

Using a series of REPLACE() functions

Here each REPLACE is used to change one unwanted character to a blank space or SPACE(0). The nesting of REPLACE function in recent version of the SQL Server product can go to hundreds of levels.

SELECT REPLACE( REPLACE( REPLACE( REPLACE( @str, '!', '' ), '#', '' ), '$', '' ), '&', '' );

If you have single special character the use the following

Using a REPLACE() function

Here each REPLACE is used to change one unwanted character to a blank space or SPACE(0). The nesting of REPLACE function in recent version of the SQL Server product can go to hundreds of levels.

SELECT REPLACE(@str, '#', '' )
0
All Courses

From novice to tech pro — start learning today.