﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Mohd Nizamuddin  / Can it possible to perform multiple Update with XML format query / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 13:32:47 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Can it possible to perform multiple Update with XML format query</title><link>http://www.sqlservercentral.com/Forums/Topic1003446-1618-1.aspx</link><description>Actually this is an interesting topic, but I would advice using SqlBulkCopy instead, which provide amazing performance, with just a few lines of code:public virtual bool SqlBulkCopy(DataSet ds, string TableName)  // provide ability to update any Table in the DS, assume TableName is idem for SQL and App Levelbool result = true;using (SqlBulkCopy BulkCopy = new SqlBulkCopy(MyConnectionString)){    BulkCopy.DestinationTableName = TableName;    try    {        BulkCopy.WriteToServer(ds.Tables[TableName]); // Write from the source to the destination.    }    catch (Exception e)    {        // Provide feedback of error issues, to be recovered using something like "DataSetErrorsShower.Show()"         ds.Tables[TableName].Rows[0].RowError = ExceptionHandler.WrapSqlException(e);        result = false;    }    if (result == true)       ds.Tables[TableName].AcceptChanges();    return result}Hope it helps, keep on comments.Kind Regards,Louis.</description><pubDate>Fri, 15 Oct 2010 00:49:17 GMT</pubDate><dc:creator>crackbridge</dc:creator></item><item><title>Can it possible to perform multiple Update with XML format query</title><link>http://www.sqlservercentral.com/Forums/Topic1003446-1618-1.aspx</link><description>I got an Idea how to Send multiple rows to the Database from an Application and from the below code we can even insert it to the table as u showed in the Articlelike,consider a table EmpINSERT INTO Emp (Name, Salary)SELECT Name, Salary FROM OPENXML (@idoc, '/ROWS/ROW', 1)WITH (Name varchar(50), Salary int)WHERE Salary &amp;gt;= 1500ORDER BY NameMy Doubt is about how to Update multiple rows in Emp table using the below xml query&amp;lt;ROWS&amp;gt;&amp;lt;ROW&amp;gt; &amp;lt;ID&amp;gt;1&amp;lt;/ID&amp;gt;&amp;lt;Name&amp;gt;Tom&amp;lt;/Name&amp;gt; &amp;lt;Salary&amp;gt;21000&amp;lt;/Salary&amp;gt; &amp;lt;/ROW&amp;gt;&amp;lt;ROW&amp;gt; &amp;lt;ID&amp;gt;2&amp;lt;/ID&amp;gt;&amp;lt;Name&amp;gt;Nitesh&amp;lt;/Name&amp;gt; &amp;lt;Salary&amp;gt;18000&amp;lt;/Salary&amp;gt; &amp;lt;/ROW&amp;gt;&amp;lt;ROW&amp;gt; &amp;lt;ID&amp;gt;3&amp;lt;/ID&amp;gt;&amp;lt;Name&amp;gt;Mat&amp;lt;/Name&amp;gt; &amp;lt;Salary&amp;gt;15000&amp;lt;/Salary&amp;gt; &amp;lt;/ROW&amp;gt;&amp;lt;/ROWS&amp;gt;Please help me out for updating the table with above xml QueryThank and Regards   Nitesh katare</description><pubDate>Wed, 13 Oct 2010 03:49:51 GMT</pubDate><dc:creator>Nitesh katare</dc:creator></item></channel></rss>