dbTalk Databases Forums  

SSIS Expression Builder Replace function

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SSIS Expression Builder Replace function in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rmoore
 
Posts: n/a

Default SSIS Expression Builder Replace function - 03-11-2008 , 02:18 PM






I'm using expressions for some of my error handling and I need help with
syntax. I need to use the replace function to remove quotes from the
parameter. Below is the code I am working with. In my example I am replacing
Quote:
with nothing. Instead of replacing |, I would like to replace ". What is
the syntax to do that?

"SELECT 'TaskName= ' + ' " + @[System::SourceName] + " ' + '
ErrorStepID= ' + ' " + @[System::SourceID] + " ' + ' ErrorCode= ' + ' " +
(DT_STR,15,1252)@[System::ErrorCode] + " ' + ' ErrorDescription= ' + ' "
+ (REPLACE(@[System::ErrorDescription], "|", "")) + " ' AS ErrorMessage "

--
RMoore


Reply With Quote
  #2  
Old   
Charles Wang[MSFT]
 
Posts: n/a

Default RE: SSIS Expression Builder Replace function - 03-12-2008 , 12:08 AM






Hi RMoore,
I understand that you would like to know how to replace " to nothing in the
error description.
If I have misunderstood, please let me know.

Please try the following:
--------------------------------------------------------------------------
"SELECT 'TASKNAME="+@[System::SourceName]
+" ErrorStepID="+@[System::SourceID]
+" ErrorCode="+(DT_STR,15,1252)@[System::ErrorCode]
+" ErrorDescription=' + REPLACE('" +@[System::ErrorDescription] + "',
'"','') AS ErrorMessage"
--------------------------------------------------------------------------

Hope this helps. If you have any other questions or concerns, please feel
free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======


Reply With Quote
  #3  
Old   
Charles Wang[MSFT]
 
Posts: n/a

Default RE: SSIS Expression Builder Replace function - 03-12-2008 , 12:08 AM



Hi RMoore,
I understand that you would like to know how to replace " to nothing in the
error description.
If I have misunderstood, please let me know.

Please try the following:
--------------------------------------------------------------------------
"SELECT 'TASKNAME="+@[System::SourceName]
+" ErrorStepID="+@[System::SourceID]
+" ErrorCode="+(DT_STR,15,1252)@[System::ErrorCode]
+" ErrorDescription=' + REPLACE('" +@[System::ErrorDescription] + "',
'"','') AS ErrorMessage"
--------------------------------------------------------------------------

Hope this helps. If you have any other questions or concerns, please feel
free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======


Reply With Quote
  #4  
Old   
Charles Wang[MSFT]
 
Posts: n/a

Default RE: SSIS Expression Builder Replace function - 03-12-2008 , 12:08 AM



Hi RMoore,
I understand that you would like to know how to replace " to nothing in the
error description.
If I have misunderstood, please let me know.

Please try the following:
--------------------------------------------------------------------------
"SELECT 'TASKNAME="+@[System::SourceName]
+" ErrorStepID="+@[System::SourceID]
+" ErrorCode="+(DT_STR,15,1252)@[System::ErrorCode]
+" ErrorDescription=' + REPLACE('" +@[System::ErrorDescription] + "',
'"','') AS ErrorMessage"
--------------------------------------------------------------------------

Hope this helps. If you have any other questions or concerns, please feel
free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======


Reply With Quote
  #5  
Old   
Charles Wang[MSFT]
 
Posts: n/a

Default RE: SSIS Expression Builder Replace function - 03-12-2008 , 12:08 AM



Hi RMoore,
I understand that you would like to know how to replace " to nothing in the
error description.
If I have misunderstood, please let me know.

Please try the following:
--------------------------------------------------------------------------
"SELECT 'TASKNAME="+@[System::SourceName]
+" ErrorStepID="+@[System::SourceID]
+" ErrorCode="+(DT_STR,15,1252)@[System::ErrorCode]
+" ErrorDescription=' + REPLACE('" +@[System::ErrorDescription] + "',
'"','') AS ErrorMessage"
--------------------------------------------------------------------------

Hope this helps. If you have any other questions or concerns, please feel
free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======


Reply With Quote
  #6  
Old   
Charles Wang[MSFT]
 
Posts: n/a

Default RE: SSIS Expression Builder Replace function - 03-12-2008 , 12:08 AM



Hi RMoore,
I understand that you would like to know how to replace " to nothing in the
error description.
If I have misunderstood, please let me know.

Please try the following:
--------------------------------------------------------------------------
"SELECT 'TASKNAME="+@[System::SourceName]
+" ErrorStepID="+@[System::SourceID]
+" ErrorCode="+(DT_STR,15,1252)@[System::ErrorCode]
+" ErrorDescription=' + REPLACE('" +@[System::ErrorDescription] + "',
'"','') AS ErrorMessage"
--------------------------------------------------------------------------

Hope this helps. If you have any other questions or concerns, please feel
free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======


Reply With Quote
  #7  
Old   
Charles Wang[MSFT]
 
Posts: n/a

Default RE: SSIS Expression Builder Replace function - 03-12-2008 , 12:08 AM



Hi RMoore,
I understand that you would like to know how to replace " to nothing in the
error description.
If I have misunderstood, please let me know.

Please try the following:
--------------------------------------------------------------------------
"SELECT 'TASKNAME="+@[System::SourceName]
+" ErrorStepID="+@[System::SourceID]
+" ErrorCode="+(DT_STR,15,1252)@[System::ErrorCode]
+" ErrorDescription=' + REPLACE('" +@[System::ErrorDescription] + "',
'"','') AS ErrorMessage"
--------------------------------------------------------------------------

Hope this helps. If you have any other questions or concerns, please feel
free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======


Reply With Quote
  #8  
Old   
Charles Wang[MSFT]
 
Posts: n/a

Default RE: SSIS Expression Builder Replace function - 03-12-2008 , 12:08 AM



Hi RMoore,
I understand that you would like to know how to replace " to nothing in the
error description.
If I have misunderstood, please let me know.

Please try the following:
--------------------------------------------------------------------------
"SELECT 'TASKNAME="+@[System::SourceName]
+" ErrorStepID="+@[System::SourceID]
+" ErrorCode="+(DT_STR,15,1252)@[System::ErrorCode]
+" ErrorDescription=' + REPLACE('" +@[System::ErrorDescription] + "',
'"','') AS ErrorMessage"
--------------------------------------------------------------------------

Hope this helps. If you have any other questions or concerns, please feel
free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======


Reply With Quote
  #9  
Old   
Charles Wang[MSFT]
 
Posts: n/a

Default RE: SSIS Expression Builder Replace function - 03-12-2008 , 12:08 AM



Hi RMoore,
I understand that you would like to know how to replace " to nothing in the
error description.
If I have misunderstood, please let me know.

Please try the following:
--------------------------------------------------------------------------
"SELECT 'TASKNAME="+@[System::SourceName]
+" ErrorStepID="+@[System::SourceID]
+" ErrorCode="+(DT_STR,15,1252)@[System::ErrorCode]
+" ErrorDescription=' + REPLACE('" +@[System::ErrorDescription] + "',
'"','') AS ErrorMessage"
--------------------------------------------------------------------------

Hope this helps. If you have any other questions or concerns, please feel
free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======


Reply With Quote
  #10  
Old   
Rmoore
 
Posts: n/a

Default RE: SSIS Expression Builder Replace function - 03-12-2008 , 07:03 AM



Charles,

I get a syntax error on the last line '"','') AS ErrorMessage". It thinks
there is an unclosed apostrophe.
--
RMoore


"Charles Wang[MSFT]" wrote:

Quote:
Hi RMoore,
I understand that you would like to know how to replace " to nothing in the
error description.
If I have misunderstood, please let me know.

Please try the following:
--------------------------------------------------------------------------
"SELECT 'TASKNAME="+@[System::SourceName]
+" ErrorStepID="+@[System::SourceID]
+" ErrorCode="+(DT_STR,15,1252)@[System::ErrorCode]
+" ErrorDescription=' + REPLACE('" +@[System::ErrorDescription] + "',
'"','') AS ErrorMessage"
--------------------------------------------------------------------------

Hope this helps. If you have any other questions or concerns, please feel
free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.