Function to Strip HTML

  • I would love an example user-defined function that can strip out html of a typical varchar(5000) field. I am not too familiar with these.

    Thanks for your help

    Chris


    </cm>

  • This is typically a client-side function that occurs prior to inserting the value in the data base. if you want a simple one, you can convert all "<" characters to ">" and cover most of your bases. it won't actually strip it out but will render it harmless (almost) when displayed on a client end.

    I think all the variables dealing with HTML would probably be more complex than a SQL UDF can readily handle.

    Again, I would do it client side in VB or another procedural language.

  • I agree there is just so much to look for as html. You might pull a fast one if you just want the data and use the MS IE Actrive addin control with VB to pull the html in and grab the text only. I think you can do this MS HTML Object library as well in a DLL that you UDF could call but I have not tried, I have done paging thru websites for various vendors on the other and needed to get and store the results of the pages (text only) using the MS Internet Controls but they can be flaky sometimes with remote data.

  • I usually do strip out with script, but this is for multiple dts jobs that generate txt files. we have html in the description so i guess i could just include some vbscript on the transformation i just thought maybe a function would work. are they resource heavy? thanks for your responses.


    </cm>

  • I haven't seen any major hits on resources in my solution. Let me know if you need help, should be interesting to try that way.

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

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