Solved

SQL 2005 String Functions

Posted on 2008-10-31
2
1,205 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQl Agent job fails--SSIS package looses password 6 59
Query to Add Late Tolerance 10 82
Help  needed 3 45
Ideas on migrating very large  system from SQL 2005 to SQL 2014 3 34
Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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