title: how to retrieve only updated products in long query?
body: <p>I have build an xml/aspx page that retrieves all rows in a producttable through sql server. This page is used as an xmlfeed. This xml displays productdetails like name, price and stock etc. Because the query is timeconsuming I would like to only retrieve the rows that have been changed( stock for example). What is the way to go about this in sql server?</p>
  
  <p>sql server</p>
  
  <pre><code>select name,price,productid
  from product
  </code></pre>
  
  <p>c#</p>
  
  <pre><code>public List&lt;Feed&gt; GetFeed()
  {
      DataSet dst = new DataSet();
      SqlCommand cmd = null;
      List&lt;Feed&gt; feedlist = new List&lt;Feed&gt;();
      using (SqlConnection conn = new SqlConnection(connectionstring))
      {
          conn.Open();
          cmd = new SqlCommand("[GetFeed]", conn);
          cmd.CommandType = CommandType.StoredProcedure;
          using (SqlDataReader rs = cmd.ExecuteReader())
          {
              while (rs.Read())
              {
                  feed feed = new Feed();
                  feed.productID = rs["ProductID"].ToString();
                  feed.price = rs["price"].ToString();
                  feedlist.Add(feed);
              }
              rs.NextResult();
          }
      }
      return feedlist;
  }
  
  
      public class Feed
  {
      public string Price { get; set; }
      public string Name { get; set; }
      public string ProductID { get; set; }
  }
  
  
    protected void Page_Load(object sender, EventArgs e)
  {
   var feeds = GetFeed();
   XElement products =
           new XElement("products",
              from p in feeds
              select new XElement("Product",
                    new XElement("id", p.ProductID),
                    new XElement("Price", p.Price),
                    new XElement("Name", p.Name)
  
              )
           );
  
      Response.ContentType = "text/xml";
      Response.Write(products.ToString());
      Response.End();
      }
  </code></pre>