Thread: SQL - Cleaning up data
-
October 16th, 2003, 09:51 PM #1Not Really a Member
- Join Date
- Oct 2001
- Posts
- 27,879
SQL - Cleaning up data
Ok I have a table I'm trying to clean up some pathetic imports.
We export DHCP tables to a text file every night and then import them into a DB for security tracking.
Now one of the columns MAC address has something funky in it I can't identify, but it seems to cause wrapping of the text
I've tried LTRIM RTRIM doesn't remove it
I've tried REPLACE(columnname, CHAR(13), '') to try to replace carriage returns in the string.. that didn't work either
HOW can I identify this mysterious white space!?!!
Its REALLY P'ing me off!! lol
makes bad data
Before I was avoiding the problem by just selecting LEFT(mac, 12) .. but when there is no mac address the same problem occurs
I've also tried CHAR(10) for line feed, and CHAR(9) for tab
Thoughts?
T-SQL
SQL Server 2000
believe datatype is varchar(20)
-
October 16th, 2003, 10:00 PM #2Not Really a Member
- Join Date
- Oct 2001
- Posts
- 27,879
HA! I am SQL GOD!
Ok.. I can wish
Just dawned on me to try both at the same time
REPLACE(replace(mac, CHAR(10), ''), CHAR(13), '')
To get rid of CarriageReturn/LineFeed combos ..
WOohoo
Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.
-
October 16th, 2003, 10:03 PM #3
that is a great smilie
good to see you got your problem solved, btw....
lmao...smilie
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)



LinkBack URL
About LinkBacks



Reply With Quote


I'm done with calculating bond premiums and discounts. I'll finish the homework tomorrow. Good night.
Is It Just Me? v233893843