Convert RTF to varchar

  • Hi Everyone,
         I was wondering if anyone knew of a way to convert an RTF field to a regular varchar string.  Meaning, I need the RTF tags stripped, only bringing back the text.  I've been looking and can't seem to find any resources on it.

         Is there something I can put in my query that will do it on the fly?

    Thanks!

  • meichmann - Friday, August 17, 2018 11:37 AM

    Hi Everyone,
         I was wondering if anyone knew of a way to convert an RTF field to a regular varchar string.  Meaning, I need the RTF tags stripped, only bringing back the text.  I've been looking and can't seem to find any resources on it.

         Is there something I can put in my query that will do it on the fly?

    Thanks!

    Looks fairly challenging in T-SQL, but not so bad in C# – so a CLR, SSIS package or C# app will do it for you.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Phil Parkin - Friday, August 17, 2018 11:50 AM

    meichmann - Friday, August 17, 2018 11:37 AM

    Hi Everyone,
         I was wondering if anyone knew of a way to convert an RTF field to a regular varchar string.  Meaning, I need the RTF tags stripped, only bringing back the text.  I've been looking and can't seem to find any resources on it.

         Is there something I can put in my query that will do it on the fly?

    Thanks!

    Looks fairly challenging in T-SQL, but not so bad in C# – so a CLR, SSIS package or C# app will do it for you.

    Hi Phil,
         Yeah, I'm trying to do it dynamically in the SQL query.  That's my only option at the moment, unless I can find a way to do it in SSIS.

  • meichmann - Friday, August 17, 2018 11:56 AM

    Phil Parkin - Friday, August 17, 2018 11:50 AM

    meichmann - Friday, August 17, 2018 11:37 AM

    Hi Everyone,
         I was wondering if anyone knew of a way to convert an RTF field to a regular varchar string.  Meaning, I need the RTF tags stripped, only bringing back the text.  I've been looking and can't seem to find any resources on it.

         Is there something I can put in my query that will do it on the fly?

    Thanks!

    Looks fairly challenging in T-SQL, but not so bad in C# – so a CLR, SSIS package or C# app will do it for you.

    Hi Phil,
         Yeah, I'm trying to do it dynamically in the SQL query.  That's my only option at the moment, unless I can find a way to do it in SSIS.

    But if you had a CLR, you'd be able to call that from within your T-SQL. If this is going to be an ongoing requirement, I'd say that a CLR is your best option.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Phil Parkin - Friday, August 17, 2018 12:06 PM

    meichmann - Friday, August 17, 2018 11:56 AM

    Phil Parkin - Friday, August 17, 2018 11:50 AM

    meichmann - Friday, August 17, 2018 11:37 AM

    Hi Everyone,
         I was wondering if anyone knew of a way to convert an RTF field to a regular varchar string.  Meaning, I need the RTF tags stripped, only bringing back the text.  I've been looking and can't seem to find any resources on it.

         Is there something I can put in my query that will do it on the fly?

    Thanks!

    Looks fairly challenging in T-SQL, but not so bad in C# – so a CLR, SSIS package or C# app will do it for you.

    Hi Phil,
         Yeah, I'm trying to do it dynamically in the SQL query.  That's my only option at the moment, unless I can find a way to do it in SSIS.

    But if you had a CLR, you'd be able to call that from within your T-SQL. If this is going to be an ongoing requirement, I'd say that a CLR is your best option.

    Phil,
         ok I'll look into that.  thanks!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply