Re: Commas in fields - Need to remove them or select without them
From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 07/07/04
- Next message: warren: "Re: xp_cmdshell"
- Previous message: rikesh: "Re: FOR XML AUTO"
- In reply to: Joseph Fessenden: "Commas in fields - Need to remove them or select without them"
- Next in thread: Chris Hohmann: "Re: Commas in fields - Need to remove them or select without them"
- Reply: Chris Hohmann: "Re: Commas in fields - Need to remove them or select without them"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 7 Jul 2004 11:19:50 -0400
SELECT REPLACE(column, ',', '-') FROM table
-- http://www.aspfaq.com/ (Reverse address to reply.) "Joseph Fessenden" <JosephFessenden@discussions.microsoft.com> wrote in message news:750CF9B0-0AB8-4E1B-94BE-49E4CEF6D782@microsoft.com... > I have a query that I need to run that gets BCPed into a CSV file. The problem is, if someone has entered a comma into the field, it ruins the BCP file. I need to know if anyone has a suggestion to do one of the following: > > 1 (preferred) - select the contents of the field either without the comma(s) or replacing the commas with another character as part of a select statement. > > 2 - update the contents of a table so that any commas (leading, trailing, or embedded) are replaced with another character (e.g. "-"). > > Thanks, > Joe F.
- Next message: warren: "Re: xp_cmdshell"
- Previous message: rikesh: "Re: FOR XML AUTO"
- In reply to: Joseph Fessenden: "Commas in fields - Need to remove them or select without them"
- Next in thread: Chris Hohmann: "Re: Commas in fields - Need to remove them or select without them"
- Reply: Chris Hohmann: "Re: Commas in fields - Need to remove them or select without them"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|