Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Don't want Carriage Return outputting

Status
Not open for further replies.

gunnermac

IS-IT--Management
Sep 12, 2001
5
0
0
GB
Hi,

Been working on Oracle for a while now and just swapped to SQL server, so excusde me for being dumb.

I have a comments field in my db which contains comma's, carriage returns, etc.

I can deal with the comma's by Double Quoting the field, but the carriage return still affects my output.

What is the function which will stop the carriage returns from displaing in the output.

I am using Query Analyser to output, is there a better free query tool out there?
 
there is no prebuilt removal tool for carriage returns what you will have to do is scan through the text field and remove the carriage returns and replace them with white spaces

look at replace(), updatetext(), writetext(), textptr() writetext(), and readtext()

On other tools that are free i don't know i use Visual Foxpro 7.0 sp1 frankly it knocks the socks of both SQL2000 and Orcale
 
If the selected column is a character data type, use the REPLACE function to eliminate the carriage returns. The following SQL statement displays the contents of the comments column after removing carriage returns (char(13)+char(10).

Select Comment = REPLACE(Comment,char(13)+char(10),' ')
From YourTable Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top