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 2008 Forums
 Transact-SQL (2008)
 Remove first space

Author  Topic 

kwacz23
Starting Member

44 Posts

Posted - 2013-08-14 : 04:17:56
I would like to only remove first space on the left side if exist.
The issue is because those below values are already in column. (it's not a text)

Example

' Win 7 32bit'- here only remove this first extra space.
'Win 7 32bit'- here should be as it is now

Please help

stepson
Aged Yak Warrior

545 Posts

Posted - 2013-08-14 : 04:27:40
use LTRIM

select LTRIM(' Win 7 32bit')

Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mut
sabinWeb
Go to Top of Page

kwacz23
Starting Member

44 Posts

Posted - 2013-08-14 : 04:29:51
It is not work

Select ltrim(response) from mytable

it still giving me ' Win 7 32bit'
Go to Top of Page

kwacz23
Starting Member

44 Posts

Posted - 2013-08-14 : 06:31:51
I figured out what was the issue.It turned out that this character was not space but feed line.


(replace(response,char(10),''))
Go to Top of Page

ShivaKrishna
Starting Member

20 Posts

Posted - 2013-08-28 : 07:11:35
stuff(' Win 7 32bit',1,1,'')
Go to Top of Page

kameswararao polireddy
Starting Member

19 Posts

Posted - 2013-08-28 : 11:16:07
Hi,
You can use LTRIM() function to complete the process.

SELECT LTRIM(' Win 7 32bit')

P.Kameswara rao
Go to Top of Page

VeeranjaneyuluAnnapureddy
Posting Yak Master

169 Posts

Posted - 2013-08-29 : 05:00:50
select CONVERT(varchar,ltrim(' Win 7 32bit'))

veeranjaneyulu
Go to Top of Page
   

- Advertisement -