Has anyone had to deal with removing punctuation (commas, apostrophes,
etc.) from a column? What is the most efficient way to have these
characters automatically removed from the column? 3 7323
use replace
update table set field = replace(field,',','') --commas
update table set field = replace(field,'.','') -- dots
update table set field = replace(field,'''','') --apostrophes
you can put this in a trigger if you want to do this automatically
------------------------------------------------------------------------------------------
"I sense many useless updates in you... Useless updates lead to
defragmentation... Defragmentation leads to downtime...Downtime leads
to suffering..Defragmentation is the path to the darkside.. DBCC
INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with
you" -- http://sqlservercode.blogspot.com/
On 24 Oct 2005 11:43:32 -0700, SQL wrote: use replace update table set field = replace(field,',','') --commas update table set field = replace(field,'.','') -- dots update table set field = replace(field,'''','') --apostrophes
Hi SQL,
More efficient to do it all in one pass:
UPDATE table
SET field = REPLACE(REPLACE(REPLACE(field,',',''),'.',''),'''' ,'')
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
Thanks!
Hugo Kornelis wrote: On 24 Oct 2005 11:43:32 -0700, SQL wrote:
use replace update table set field = replace(field,',','') --commas update table set field = replace(field,'.','') -- dots update table set field = replace(field,'''','') --apostrophes
Hi SQL,
More efficient to do it all in one pass:
UPDATE table SET field = REPLACE(REPLACE(REPLACE(field,',',''),'.',''),'''' ,'')
Best, Hugo --
(Remove _NO_ and _SPAM_ to get my e-mail address) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ralph Freshour |
last post by:
I'm taking text from a textarea object and want to strip out
characters other than A-Za-z0-9 before I send the data to MySQL table
- is there a function I can use to do this in PHP?
Thanks...
|
by: Andy Jefferies |
last post by:
I'm having problems stripping out the whitespace at the beginning of a
particular element. In the XML snippet I've highlighted tabs and returns
as ^I and ^M respectively:
<para> ^I ^I ...
|
by: Jeff North |
last post by:
Hi,
I'm using a control called HTMLArea which allows a person to enter
text and converts the format instructions to html tags. Most of my
users know nothing about html so this is perfect for my...
|
by: Lachlan Hunt |
last post by:
Hi,
I have recently downloaded and experemented with IBM HPR 3.0, and
Opera 8 with text-to-speech, and have come to realise some fairly
annoying issues regarding punctuation marks.
I've found,...
|
by: dew |
last post by:
Is there an easy way to edit a string so that only alphabetical characters
and numbers are allowed? Thanks for your help.
|
by: et |
last post by:
How can I strip out unwanted characters in a string before updating the
database? For instance, in names & addresses in our client table, we want
only letters and numbers, no punctuation. Is...
|
by: Anat |
last post by:
Hi,
I need a little help on performing string manipulation:
I want to take a given string, and make certain words hyperlinks.
For example:
"Hello world, this is a wonderful day!"
I'd like the...
|
by: watcher00 |
last post by:
Hi
I'm a complete newbie at Perl and i was wondering if i can get some help completing an exercise i've come across.
I need to count the punctuation marks from a text file and then output a...
|
by: shabda raaj |
last post by:
I want to strip punctuation from text.
So I am trying,
' !! ! ... ?'
Which gave me all the chars which I want to replace.
So Next I tried by negating the regex,
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |