LTRIM usage with SQL server 2005 -


I am a small number of SQL numbers, so please forgive me. I can not get an example of LTRI use anywhere.

I have a NIHARAR column in my table, in which there is a separate place in many entries - I think if I run it then it should do the trick:

  SELECT LTRIM (ColumnName) from TableName;  

Will this give the desired results? No, it will trim the major space but not all white locations (such as carriage return).

Edit It looks like you're looking for a UPDATE query that is the main and the white space behind

If you mean "general" blank space only use

  update table name SET columnname = LTRIM (RTRIM (ColumnName))  

It should do this for all the white space (from here). Back up your data first!

  Update table name SET columnname = SUBSTRING (columnname, Pattydx ('%' ^ [char + (9) + char (10) + char (13) + char (20 ('% [ ^ 'Char (09) + char (10) + char (13) + char (20) +']% ', column name (' '%' ', column name), LN (columnname) - PATINDEX ('% [^ '+ Char (09) + char (10) + char (13) + char (20) +']% ', reverse (columnname) + 2)  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -