Commerce Server Blog

Build world class ecommerce applications using Microsoft Commerce Server
  •  
  • Home
  • Advertise
  • Copyright Policy
  • Disclaimer
  • About

Using XML Data Types in Order System

ravikanth | May 13, 2009

I saw a post in commerce communities asking how to use XML data types in commerce server order system. Commerce server (CS) does have some constraints on data types. Since CS is working with SQL Server, we should not assume that it supports all the data types supported by SQL server. Click below links to know more about the supported .NET and SQL Server data types.

http://msdn.microsoft.com/en-us/library/aa545934.aspx

http://msdn.microsoft.com/en-us/library/dd464501.aspx

If your question is “I have to use XML Data type” and the straight forward answer is “No”. I have small work around for this problem – and it may or may not work for you.

  • Create two columns in database
    • column1 of type nvarchar(max)
    • column2 of type xml
  • Extend order system as explained in MSDN site add map the XML to the column 1 (assuming that you are storing serialized object data in column 1).
  • Write a database trigger to update Column 2 when Column 1 changes.

At a given point of time, data in both columns will be same. Whenever you want to use XML Search feature then you can use column 2 and whenever you want to work on XML data through C# then you can get serialized data from column1, desterilize back and manipulate the object.

Categories
Commerce Server 2009
Comments rss
Comments rss
Trackback
Trackback

« Commerce Server Starter Site Demo Filed to retrieve the AzMan Scope »

2 Responses to “Using XML Data Types in Order System”

  1. arik says:
    May 14, 2009 at 10:21 am

    Ravi ,
    Have you ever tried using triggers on the order tables?
    Won’t i get performance issues ?

    thanks
    arik

    Reply
    • ravikanth says:
      May 14, 2009 at 8:22 pm

      Arik, it depends on the data load you are having on the site. Ideally we archive old information to another server (may be 3 months old). In that context the order tables will not have not much information and a trigger will not cause any performance issue. If you are keeping all old information in the same table, this approach may create some performance issues in long run. That is the reason, I mentioned – “The solution may or May not work for you”.

      Hope this helps.

      Reply

Leave a Reply

Click here to cancel reply.

Powered by WP Hashcash

Sign up for Newsletter


Categories

Quiz

  • Catalog Quiz for Beginners
  • Profile Quiz for Beginners
  • Quiz 1 for Advance Users
  • Quiz for Beginners

Recent Posts

  • RCXml2Resx.exe tool stops working
  • Commerce Server Profile Importer Tool
  • Marketing Web service Exception: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM
  • Download Commerce Server 2009 Help Document
  • Commerce Server 2009 work with SharePoint 2010?
  • Failed to set value for profile property ‘email_address’.
  • ArgumentException: An item with the same key has already been added.
  • Please note that one or more items were removed from your order because the product is no longer sold.
  • How to Avoid Duplicate Orders Numbers in Commerce Server
  • Error: Microsoft.Commerce.Contracts.Faults.ItemDoesNotExistFault

Archives

  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008

Tags

add discounts add images to profile Advantages of commerce server approve discounts authentication auto login process automatic user creation basket Brand Management business tools campaign management Catalog catalog import Category CategoryConfiguration commerce server commerce server 2007 commerce server manager Commerce Server SP2 discounts ecommerce Estimation Installation inventory Kanth Koppala marketing system migration error Mojave operation components operation sequence Order subsystem Product profile profile subsystem property metadata purchase order quick checkout Ravi Ravi Kanth site cache refresh starter site tools transactions error Variant
(c) 2009 Commerce Server Blog. All rights Reserved. Articles cannot be reproduced without permission from the author.Write to me at kanth@ravikanth.net if you have any comments, questions, suggestions about this site or would like to send us a tip
About Us | Terms of Use | Disclaimer | Advertise .