Asked by sikyala
at 2024-11-01 07:33:53
Point:500 Replies:4 POST_ID:828768USER_ID:11674
Topic:
MS SQL Server;;Windows 2003 Server
I have text in a field that looks like the following:
Contract_no
-----------------
AB-123C-4567
DE-892F-
6007
GH-292I-J2006
KL-3434-
M2008
That is actually 4 rows of data. The data was entered for some of the records with what looks like a hard return. When I try to use BCP to export the records and remove the whitespace it doesn't work. How should I fix this?
I tried the following select statement in my export select RTRIM(LTRIM(contract_no)) from contracts
Contract_no
-----------------
AB-123C-4567
DE-892F-
6007
GH-292I-J2006
KL-3434-
M2008
That is actually 4 rows of data. The data was entered for some of the records with what looks like a hard return. When I try to use BCP to export the records and remove the whitespace it doesn't work. How should I fix this?
I tried the following select statement in my export select RTRIM(LTRIM(contract_no)) from contracts