August 24, 2008 at 11:33 pm
How can i remove the last two letters of every row in a column?
August 25, 2008 at 12:29 am
UPDATE Table SET col = LEFT(col, LEN(col) - 2)
Ivan Budiono
August 25, 2008 at 12:43 am
Something like this should work, provided the column in question is varchar or nvarchar. If it doesn't do what you want, could you give us more details, including some sample data and desired output.
Update MyTable Set SomeColumn = LEFT(SomeColumn, LEN(SomeColumn)-2)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply