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
 General SQL Server Forums
 New to SQL Server Programming
 update xml data type

Author  Topic 

asm
Posting Yak Master

140 Posts

Posted - 2012-02-23 : 01:11:41
Hi,

How to update a xml datatype filed in a table based on where condition.

Inserting in table --
INSERT INTO kml SELECT * FROM OPENROWSET(BULK 'E:\Backups\doc.kml', SINGLE_BLOB) as x

update
UPDATE kml SET kmlstring.modify(SELECT * FROM OPENROWSET(BULK 'E:\Sunil DBackups\doc.kml', SINGLE_BLOB) as x) where id=2

it gives error....


thanks

Jan Novak
Starting Member

6 Posts

Posted - 2012-02-23 : 03:42:19
UPDATE kml
SET kmlstring = Cast(
(SELECT * FROM OPENROWSET(BULK 'E:\Sunil DBackups\doc.kml', SINGLE_BLOB) as x)
As Xml)
where id=2
Go to Top of Page
   

- Advertisement -