dbTalk Databases Forums  

Update Query using XQuery

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Update Query using XQuery in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
CK
 
Posts: n/a

Default Update Query using XQuery - 11-27-2006 , 02:55 PM






UPDATE Sales.DeliverySchedule
SET DeliveryList.modify('declare namespace
df=http://schemas.adventure-works.com/DeliverySchedule;
replace value of (dfeliveryList/dfelivery/df:Address)[1]' with "7194
Fourth St., Rockhampton"')
WHERE Sales.DeliverySchedule.ScheduleID = 1

This query gives me the following error
XQuery [Sales.DeliverySchedule.DeliveryList.modify()]: Invalid source
character 0x2019

Any ideas? What am I doing wrong here? Thanks for any advice.
TIA,
~CK








Reply With Quote
  #2  
Old   
markc600@hotmail.com
 
Posts: n/a

Default Re: Update Query using XQuery - 11-27-2006 , 03:27 PM







Try this



UPDATE Sales.DeliverySchedule
SET DeliveryList.modify('declare default element namespace
"http://schemas.adventure-works.com/DeliverySchedule";
replace value of (DeliveryList/Delivery/Address[1]/text())[1] with
"7194 Fourth St., Rockhampton"')
WHERE Sales.DeliverySchedule.ScheduleID = 1


Reply With Quote
  #3  
Old   
CK
 
Posts: n/a

Default Re: Update Query using XQuery - 11-27-2006 , 03:43 PM



I tried it and I get the same error. Any other ideas?
*****I just tried this and it works great!!!

UPDATE Sales.DeliverySchedule
SET DeliveryList.modify('declare default element namespace
http://schemas.adventure-works.com/DeliverySchedule;
replace value of (DeliveryList/Delivery/Address[1])[1] with "7194 Fourth
St., Rockhampton"')
WHERE ScheduleID = 1

<markc600 (AT) hotmail (DOT) com> wrote

Quote:
Try this



UPDATE Sales.DeliverySchedule
SET DeliveryList.modify('declare default element namespace
"http://schemas.adventure-works.com/DeliverySchedule";
replace value of (DeliveryList/Delivery/Address[1]/text())[1] with
"7194 Fourth St., Rockhampton"')
WHERE Sales.DeliverySchedule.ScheduleID = 1




Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.