Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
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
Author: sikyala replied at 2024-11-07 08:38:09
thanks
Author: sikyala replied at 2024-11-01 07:46:56
I mannually entered the sample data I am viewing it inside of sql server I open the table and look at the field values. Then I export it using bcp the data appears in the text file the same way. I will try the replace argument
Accepted Solution
Expert: Brian Crowe replied at 2024-11-01 07:42:30
500 points EXCELLENT
You can try stripping them out of the data using REPLACE. CHAR(10) and CHAR(13) are newline and carriage return characters.
SELECT REPLACE(REPLACE(myColumn, CHAR(13), ''), CHAR(10), '')
SELECT REPLACE(REPLACE(myColumn, CHAR(13), ''), CHAR(10), '')
Expert: duncanb7 replied at 2024-11-01 07:39:21
where you view the information ?
Contract_no
-----------------
AB-123C-4567
DE-892F-
6007
GH-292I-J2006
KL-3434-
M2008
You view the data in webpage or in mysql database in phpmyadmin ?
If you view it in html page, you need to
set p tag with CSS
<style>
p
{
white-space:nowrap;
}
</style>
take a look for minus-sign in html page
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_28230776.html
Contract_no
-----------------
AB-123C-4567
DE-892F-
6007
GH-292I-J2006
KL-3434-
M2008
You view the data in webpage or in mysql database in phpmyadmin ?
If you view it in html page, you need to
set p tag with CSS
<style>
p
{
white-space:nowrap;
}
</style>
take a look for minus-sign in html page
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_28230776.html