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.
| Author |
Topic |
|
arifliminto86
Starting Member
7 Posts |
Posted - 2008-02-06 : 19:40:17
|
| hi all, i am still a newbie in sqli got a problem with my queryfor example:-------------------------------DECLARE @LongString VARCHAR(10)@LongString = "Hello-Word"------------------------i want to change the LongString value by removing the "-" however i i need to identify if the @longString got "-" and delete it if it found how do i do that in sql Thanks a lot guysarifliminto86 |
|
|
hey001us
Posting Yak Master
185 Posts |
Posted - 2008-02-06 : 20:53:32
|
| select replace('Hello-Word','-','')hey |
 |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2008-02-07 : 09:59:02
|
| DECLARE @LongString VARCHAR(10)SET @LongString = 'Hello-Word'select replace(@LongString,'-',' ')Note the ' ' in the replace , as opposed to '' , as this would cause 'HelloWord'Jack Vamvas--------------------Search IT jobs from multiple sources- http://www.ITjobfeed.com |
 |
|
|
arifliminto86
Starting Member
7 Posts |
Posted - 2008-02-07 : 10:18:55
|
| thanks it solvedarifliminto86 |
 |
|
|
|
|
|