Solved

SQL 2005 String Functions

Posted on 2008-10-31
2
1,202 Views
Last Modified: 2012-05-05
Hi there,
I need to detect the presence of linefeed/new line characters in a string I'm parsing in SQL 2005.

The string is of the format ~1000~3483923~893493~...~A~Temp~End
The elements are split by the delimiter and inserted in a table. Sometimes, the string contains newline characters in the middle of numbers which SQL parses and returns as 599.3 233 with a space in between

trying REPLACE(Element,' ','') does not work because SQL still recognises it as a newline and not a space. Does anyone know what is to be specified in the REPLACE function?

Thanks,
0
Comment
Question by:Ignis2000
2 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 250 total points
ID: 22850267
try this:

replace(REPLACE(Element,char(10),''), char(13), '')
0
 

Author Closing Comment

by:Ignis2000
ID: 31512043
Great stuff!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now