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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Trim the data

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2005-01-26 : 17:11:43
I have data looks like

Name
--------
CAD disease
Diabetes disease
Asthma disease
Back & Neck disease

I would like to select only the name part excluding ‘disease’ part.

The output should look like

Name
-------
CAD
Diabetes
Asthma
Back & Neck





nr
SQLTeam MVY

12543 Posts

Posted - 2005-01-26 : 17:29:51
replace(Name, ' disease', '')


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -