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 2005 Forums
 Transact-SQL (2005)
 trim query

Author  Topic 

jtwork
Yak Posting Veteran

82 Posts

Posted - 2007-10-11 : 09:17:12
Im trying to work out how to trim a column in a table using sql query but im having a few problems. Can anyone point me in the right direction?



exec Temp Set Temp.term_code = Trim("term_code")

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-10-11 : 09:19:53
[code]Update Temp
set term_code = ltrim(rtrim(term_code))[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-11 : 09:20:14
Hmmm... Start with explaining what you are trying to attempt.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-11 : 09:21:41
quote:
Originally posted by jtwork

Im trying to work out how to trim a column in a table using sql query but im having a few problems. Can anyone point me in the right direction?



exec Temp Set Temp.term_code = Trim("term_code")


The syntax is wrong
Learn SQL

Madhivanan

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

jtwork
Yak Posting Veteran

82 Posts

Posted - 2007-10-11 : 09:50:53
Thanks Harsh that worked lovley
Go to Top of Page
   

- Advertisement -