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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing Carriage Returns 1

Status
Not open for further replies.

edwardturner

Technical User
Jul 13, 2005
25
GB
Hi,

Using a SQL statement how can I remove carriage returns from an ntext field? I have tried using the replace function but do not know what to use to denote a carriage return:

update <table>
set <field> = replace(cast(<field> as nvarchar), A, B)

A being a carriage return
B being what I want to replace it with, i.e. nothing.

any ideas or am i going about this the wrong way?
 
A = Char(13) + Char(10)
B = ''

?

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top