Home > Archive > MS SQL Server > October 2006 > SSIS replace functionality for derived column using ASCII









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 SSIS replace functionality for derived column using ASCII
billsdropbox@gmail.com

2006-10-24, 6:38 pm

Hello,
This is a problem dealing with SSIS. I am trying to use to replace a
value using a derived column data flow transformation. I would like to
replace the character " with a blank space. Here is the code:

REPLACE([Column 0], What do i put here?,"")

I am fairly certain that I will need to use the ASCII code for " which
is 34.

Thanks for any help,
Bill

John Bell

2006-10-24, 6:38 pm

Hi Bill

To put an explicit ascii character in use the CHAR() function e.g. CHAR(34).
For the empty string you could use SPACE(0). In general you may want to use
single quotes for your string to avoid potential QUOTED_IDENTIFIER problems.

John

"billsdropbox@gmail.com" wrote:

> Hello,
> This is a problem dealing with SSIS. I am trying to use to replace a
> value using a derived column data flow transformation. I would like to
> replace the character " with a blank space. Here is the code:
>
> REPLACE([Column 0], What do i put here?,"")
>
> I am fairly certain that I will need to use the ASCII code for " which
> is 34.
>
> Thanks for any help,
> Bill
>
>

John Bell

2006-10-24, 6:38 pm

Hi Bill

Sorry somehow I missed that this was in SSIS. I don't know if CHAR with
therefore work!

John

"John Bell" wrote:
[color=darkred]
> Hi Bill
>
> To put an explicit ascii character in use the CHAR() function e.g. CHAR(34).
> For the empty string you could use SPACE(0). In general you may want to use
> single quotes for your string to avoid potential QUOTED_IDENTIFIER problems.
>
> John
>
> "billsdropbox@gmail.com" wrote:
>
billsdropbox@gmail.com

2006-10-24, 6:38 pm

Hey John,
Yeah, CHAR(34) won't work, I already tried that.. but thanks.
Bill

John Bell wrote:[color=darkred
]
> Hi Bill
>
> Sorry somehow I missed that this was in SSIS. I don't know if CHAR with
> therefore work!
>
> John
>
> "John Bell" wrote:
>

John Bell

2006-10-24, 6:38 pm

Hi Bill

Checking out Books Online on IS expression concepts a '' is used as an
escape for character literals, \\ for a backslash \n for a newline \r for a
carriage return \" for a quotion mark and \xhhhh
for a unicode value in hex notation.

HTH

John

"billsdropbox@gmail.com" wrote:

> Hey John,
> Yeah, CHAR(34) won't work, I already tried that.. but thanks.
> Bill
>
> John Bell wrote:
>
>

billsdropbox@gmail.com

2006-10-24, 6:38 pm

Thanks John, but a /" did not seem to do it either...

Bill

John Bell wrote:[color=darkred
]
> Hi Bill
>
> Checking out Books Online on IS expression concepts a '' is used as an
> escape for character literals, \\ for a backslash \n for a newline \r for a
> carriage return \" for a quotion mark and \xhhhh
> for a unicode value in hex notation.
>
> HTH
>
> John
>
> "billsdropbox@gmail.com" wrote:
>

John Bell

2006-10-24, 6:38 pm

Hi Bill

The expression would be "\"" . Do you get an error message?

John

"billsdropbox@gmail.com" wrote:

> Thanks John, but a /" did not seem to do it either...
>
> Bill
>
> John Bell wrote:
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com