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
 removing text from column name

Author  Topic 

simi28
Starting Member

27 Posts

Posted - 2007-05-18 : 06:11:01
Hi all
i want to remove text from my column name using query.
for example
i have the product name like "silver 8' trampoline pack "
i need to remove "silver 8' " and want to display only trampoline pack
similarly if I have product name like "gold 8' trampoline pack"
i need to display only trampoline pack.
can anybody help me in this regard?

thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-05-18 : 06:14:58
what is the rule ? How do you decide what to remove what you retain ?

Check out the books online on string function like replace(), stuff() etc


KH

Go to Top of Page

simi28
Starting Member

27 Posts

Posted - 2007-05-18 : 06:34:34
thanks for ur reply.

I have got so many functions
but I need to know how can I remove the characters when it is not fixed.
it may be silver 8' from silver 8' trampoline pack or may be gold 10' from gold 10' trampoline delux pack.
i want to know how can fixed the length to remove
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-05-18 : 06:36:12
is it anything before the single quote ?

you can use charindex to find the location of the single quote


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-18 : 06:36:30
Also read about charindex

Madhivanan

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

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-18 : 06:38:19


Madhivanan

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

- Advertisement -