Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 I can't use UPDATETEXT to replace <![CDATA[

Author  Topic 

jimmy.hunt
Starting Member

21 Posts

Posted - 2006-04-13 : 18:09:01
I'm using this script to update the text.

http://www.aspfaq.com/show.asp?id=2445

For some reason I can't do this:

SET @oldString = N'<![CDATA[';
SET @newString = N'';

It isn't removing the <![CDATA[.

What is wrong?

James Hunt

jimmy.hunt
Starting Member

21 Posts

Posted - 2006-04-13 : 18:26:14
OK. I COULD DO THIS:
SET @oldString = N'CDATA';
SET @newString = N'';

and this:

SET @oldString = N'<!';
SET @newString = N'';

but NOT this:

SET @oldString = N'[[';
SET @newString = N'';

or this:

SET @oldString = N'[';
SET @newString = N'';

Any clues?

Thanks!

James Hunt
Go to Top of Page

jimmy.hunt
Starting Member

21 Posts

Posted - 2006-04-17 : 21:37:21
Does anyone have a clue on this? I still haven't solved this problem.

Thanks!

James Hunt
Go to Top of Page

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2006-04-18 : 06:16:49
Hi James,

I'm not familiar with that script, but I see it's using patindex - and the '[' character has special behaviour when it comes to that. Take a look at this, for example...

select patindex('%3%', '123[456')
select patindex('%[%', '123[456')
select patindex('%[[]%', '123[456')

So, try changing...
SET @oldString = N'[';

...to...
SET @oldString = N'[[]';

Just a guess!

Ryan Randall
www.monsoonmalabar.com London-based IT consultancy

Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page
   

- Advertisement -