Two questions and a clarification:
Clarification: What are you using to build the @sql string? Is this completely encapsulated in an OLEDB or Exectute SQL task, or are you assembling a local variable in a script component first?
Question 1: Have you performed a profiler to confirm the query being sent to the SQL Server is the one you expect?
Question 2: Have you directly confirmed that your character is definately a CHR(63) via ASCII(SUBSTRING())?
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA