I have an column with email in table customer
where the data in the column contains special character: TAB
When I do a select, I need to remove the TAB space from that column.
Means there is an empty TAB space followed by the EmailID: xyz.com
I tried using the LTRIM
and RTRIM
but that does not work here.
There are tabs in the source SQL table data. I want to clean these tabs and extra spaces (Transformations) before moving data to the fixed width flat file. You may use the Derived Transformation task. Option 2: Use Script Component in Transformation Mode or Source Mode and use the Trim() method available.
For anyone using SQL Server 2017 or newer Please note that the default behavior of TRIM is to remove only spaces, so in order to also remove the tabs and newlines (CR + LFs), you need to specify the characters FROM clause.
Try this code
SELECT REPLACE([Column], char(9), '') From [dbo.Table]
char(9) is the TAB character
UPDATE Table SET Column = REPLACE(Column, char(9), '')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With