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
 SQL Server Development (2000)
 deleteing all trailing characters

Author  Topic 

Jim77
Constraint Violating Yak Guru

440 Posts

Posted - 2006-08-11 : 06:04:23
hello
could anyone please advise me how to delete all trailing A's in the following table please with out doing a select ...into..., if I only want left(prodcode,5) in that column instead of left(prodcode,6) which it is at the moment please ?

ProdCode Proddescrip

12345A Beans
12343A Bread
12121A Butter

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-08-11 : 06:06:16
this is what you want ?
update table
set ProdCode = left(ProdCode, 5)



KH

Go to Top of Page

Jim77
Constraint Violating Yak Guru

440 Posts

Posted - 2006-08-11 : 06:10:58
cheers mate now that is what aI call a quick response cheers K.H.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-11 : 12:37:12
or

update table
set ProdCode = substring(ProdCode, 1,5)



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -