Friday, 28 June 2013

Query to remove last comma/character in column update in sql server

Try this sql query to update data of column as remove last comma from column value..........

" UPDATE tablename
SET colname= LEFT(colname, len(colname) -1)
WHERE RIGHT(colname,1) = ',' "

No comments:

Post a Comment