|
Home > Archive > MS SQL Server > March 2006 > fields contain carriage returns in csv export
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
fields contain carriage returns in csv export
|
|
|
| Hi,
I'm using a SQL2000 DTS to do a default export of a table to a csv file.
The line delimiter is a CRLF and this is fine, but I'm also finding
CRLF are located in the middle of fields.
Is there a way to quickly edit the text file or change the DTS to
replace the CRLFs inside any field delimiters "" with commas?
many thanks
Craig
| |
| Uri Dimant 2006-03-28, 7:23 am |
| Hi
SELECT REPLACE(column ,CHAR(13)+CHAR(10),'
')
"Craig" <craig_york@hotmail.com> wrote in message
news:ewrzHvkUGHA.6048@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I'm using a SQL2000 DTS to do a default export of a table to a csv file.
> The line delimiter is a CRLF and this is fine, but I'm also finding CRLF
> are located in the middle of fields.
>
> Is there a way to quickly edit the text file or change the DTS to replace
> the CRLFs inside any field delimiters "" with commas?
>
> many thanks
> Craig
| |
|
| Uri,
Can I do this without affecting the raw data in the database, just the
export?
craig
Uri Dimant wrote:
> Hi
> SELECT REPLACE(column ,CHAR(13)+CHAR(10),'
')
>
>
>
> "Craig" <craig_york@hotmail.com> wrote in message
> news:ewrzHvkUGHA.6048@TK2MSFTNGP11.phx.gbl...
>
>
>
>
| |
| Uri Dimant 2006-03-28, 7:23 am |
| In my example you are not affecting the data in the table. It is just for
reporting
To affect issue UPDATE Table SET col=REPLACE(col,CHAR
(13) +CHAR(10),'')
WHERE ..........
"Craig" <craig_york@hotmail.com> wrote in message
news:OXpGp1kUGHA.4956@TK2MSFTNGP09.phx.gbl...[color=darkred]
> Uri,
>
> Can I do this without affecting the raw data in the database, just the
> export?
>
> craig
>
>
>
> Uri Dimant wrote:
| |
|
| Many thanks Uri, this works great :-)
Uri Dimant wrote:
> In my example you are not affecting the data in the table. It is just for
> reporting
>
> To affect issue UPDATE Table SET col=REPLACE(col,CHAR
(13) +CHAR(10),'')
> WHERE ..........
>
>
> "Craig" <craig_york@hotmail.com> wrote in message
> news:OXpGp1kUGHA.4956@TK2MSFTNGP09.phx.gbl...
>
>
|
|
|
|
|