dbTalk Databases Forums  

xml update

microsoft.public.sqlserver.xml microsoft.public.sqlserver.xml


Discuss xml update in the microsoft.public.sqlserver.xml forum.



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

Default xml update - 05-21-2008 , 10:35 AM






I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

If I removed "[1]" in the query, I got
XQuery [mytable.xml.modify()]: The target of 'replace' must be at most one
node, found 'element(myelement,xdt:untyped) *'

I am sure it has only one instance of the element in the xml with the given
id.

What is the problem?

Reply With Quote
  #2  
Old   
Joe Fawcett
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 10:44 AM






Is the XML column typed?

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Roy" <Roy (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

If I removed "[1]" in the query, I got
XQuery [mytable.xml.modify()]: The target of 'replace' must be at most one
node, found 'element(myelement,xdt:untyped) *'

I am sure it has only one instance of the element in the xml with the
given
id.

What is the problem?



Reply With Quote
  #3  
Old   
Joe Fawcett
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 10:44 AM



Is the XML column typed?

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Roy" <Roy (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

If I removed "[1]" in the query, I got
XQuery [mytable.xml.modify()]: The target of 'replace' must be at most one
node, found 'element(myelement,xdt:untyped) *'

I am sure it has only one instance of the element in the xml with the
given
id.

What is the problem?



Reply With Quote
  #4  
Old   
Joe Fawcett
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 10:44 AM



Is the XML column typed?

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Roy" <Roy (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

If I removed "[1]" in the query, I got
XQuery [mytable.xml.modify()]: The target of 'replace' must be at most one
node, found 'element(myelement,xdt:untyped) *'

I am sure it has only one instance of the element in the xml with the
given
id.

What is the problem?



Reply With Quote
  #5  
Old   
Joe Fawcett
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 10:44 AM



Is the XML column typed?

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Roy" <Roy (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

If I removed "[1]" in the query, I got
XQuery [mytable.xml.modify()]: The target of 'replace' must be at most one
node, found 'element(myelement,xdt:untyped) *'

I am sure it has only one instance of the element in the xml with the
given
id.

What is the problem?



Reply With Quote
  #6  
Old   
Joe Fawcett
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 10:44 AM



Is the XML column typed?

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Roy" <Roy (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

If I removed "[1]" in the query, I got
XQuery [mytable.xml.modify()]: The target of 'replace' must be at most one
node, found 'element(myelement,xdt:untyped) *'

I am sure it has only one instance of the element in the xml with the
given
id.

What is the problem?



Reply With Quote
  #7  
Old   
Joe Fawcett
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 10:44 AM



Is the XML column typed?

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Roy" <Roy (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

If I removed "[1]" in the query, I got
XQuery [mytable.xml.modify()]: The target of 'replace' must be at most one
node, found 'element(myelement,xdt:untyped) *'

I am sure it has only one instance of the element in the xml with the
given
id.

What is the problem?



Reply With Quote
  #8  
Old   
Joe Fawcett
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 10:44 AM



Is the XML column typed?

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Roy" <Roy (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

If I removed "[1]" in the query, I got
XQuery [mytable.xml.modify()]: The target of 'replace' must be at most one
node, found 'element(myelement,xdt:untyped) *'

I am sure it has only one instance of the element in the xml with the
given
id.

What is the problem?



Reply With Quote
  #9  
Old   
Joe Fawcett
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 10:44 AM



Is the XML column typed?

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Roy" <Roy (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

If I removed "[1]" in the query, I got
XQuery [mytable.xml.modify()]: The target of 'replace' must be at most one
node, found 'element(myelement,xdt:untyped) *'

I am sure it has only one instance of the element in the xml with the
given
id.

What is the problem?



Reply With Quote
  #10  
Old   
Joe Fawcett
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 10:44 AM



Is the XML column typed?

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Roy" <Roy (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

If I removed "[1]" in the query, I got
XQuery [mytable.xml.modify()]: The target of 'replace' must be at most one
node, found 'element(myelement,xdt:untyped) *'

I am sure it has only one instance of the element in the xml with the
given
id.

What is the problem?



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 - 2012, Jelsoft Enterprises Ltd.