Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 25th, 2006, 10:31 AM
bubberz bubberz is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Posts: 5 bubberz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 2 sec
Reputation Power: 0
Question UpdateText() not working correctly

I'm trying to run the following SQL against my column, Testtbl.Task

I want to replace where the ampersand sign got HTML encoded to
"&", and I want to strip it down to only the ampersand sign and delete the "amp" and the ";".

It executes, but I still have the HTML encoding for the ampersand sign.


USE WI
GO
EXEC sp_dboption 'WI', 'select into/bulkcopy', 'true'
GO
DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR(Task)
FROM Testtbl
WHERE Task like '%amp;%'
UPDATETEXT Testtbl.Task @ptrval 88 0 ''
--Tried this to @ptrval 0 0 '', @prtrval 1 0 '', etc
GO
EXEC sp_dboption 'WI', 'select into/bulkcopy', 'false'
GO

Reply With Quote
  #2  
Old May 25th, 2006, 11:40 AM
bubberz bubberz is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Posts: 5 bubberz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 2 sec
Reputation Power: 0
Question edit to query....still not working though

Sorry...line should have been:

UPDATETEXT Testtbl.Task @ptrval 0 8

...since the start will be at the "amp;" (0), and for each character it's 2 bytes (8), and with saying nothing for the update text, it just deletes the "amp;"...at least that's what books online says, but I'm missing something.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > UpdateText() not working correctly


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT