Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Procedure Code - Remove

Author  Topic 

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2008-08-04 : 15:15:59
Hi,

I have a procedure code and part of my coding is this below. I would like to remove anything that says Speaks with a space. All I keep getting is this....(SPEAKS ARABICSPEAKS ENGLISHSPEAKS FRENCH)

UPDATE dhs_MonthEndProvidersREVISED
SET [Language] = REPLACE([Language], '%SPEAKS%', ' ')

Can you help me?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-04 : 15:26:28
REPLACE([Language], 'SPEAKS', '')

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2008-08-04 : 15:43:15
Thank you, that worked! Now what if I wanted to put a comma in where the space was but didn't want the comma to go infront of the first word ex. ,english,italian,chinese,

quote:
Originally posted by tkizer

REPLACE([Language], 'SPEAKS', '')

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog


Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-04 : 16:16:38
Just put in the comma and then remove it with either RIGHT or SUBSTRING functions.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -