We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Select that removes html from text

ubsmail
ubsmail asked
on
Medium Priority
233 Views
Last Modified: 2012-05-11
Hello,

I would like to select text from a field but remove the HTML code below is a example.

"<script language="Javascript">xtraImgs = 2;</script> This item has a great feel and nice fit."
Comment
Watch Question

Jagadishwor DulalSenior Web Developer
CERTIFIED EXPERT

Commented:
You can not remover any thing in query just fetch the record and you can create a function to remove html code.
CERTIFIED EXPERT
Top Expert 2012

Commented:
Is the data type really text?
Are you still using SQL Server 2000?

If the answer is yes to both of those question than you will have no choice but to use the deprecated UPDATETEXT() function.
CERTIFIED EXPERT

Commented:

Author

Commented:
Yes it is a SQL Server 2000
CERTIFIED EXPERT
Top Expert 2012

Commented:
And is the data type text?
If it is text, is the maximum length greater 8000?  You can find out by doing something like this:
SELECT MAX(DATALENGTH(YourTextCol))
From YourTableNameGoesHere

If the answer is yes to both of these questions than you will have to resort to using the deprecated UPDATETEXT() function.

Author

Commented:
The datatype is text and the below query returned 1546

SELECT MAX(DATALENGTH(FULLINFO))
From stockinf

CERTIFIED EXPERT
Top Expert 2012
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.