• Home
  • About
  • BestBloggingIdeas
  • DotNetLearningSource
  • FORUM
  • Joblinks
  • Latest News
  • Policy
  • POSTS
  • SimplySqlServer.Com && SimplyAspDotNet.Com
  • Sitemap

Join Ours Forum

Asp.Net,C#,Ajax,Sql server,silverlight,Javascript codes exambles articles,Programming exambles

RSS Feed
  • Bounty Huge Roll [Amazon Frustration-Free Packaging]
  • XML Introduction to XML VHS Video Training, 1 hr., 32 minutes.
  • The Basic Overview of Windows Mobile Development Asp.Net C#
  • Overview of Sql server extended properties Asp.Net C#
  • How to Use Sql Server Extended properties using visual studio Asp.Net C#
  • Adobe Dreamweaver Templates Accelerate Web Development
  • Top Tips for Web Design Projects
  • How to Achieve a Good Web Design Structure
  • To Use Or Not To Use Website Templates
  • Five Tips to a Successful Website
  • Top 10 Articles,


    Silverlight Datagrid Select Update Delete Insert Asp.Net C#

    Differences Similarities Benefits Between Typed Datasets and Untyped Datasets asp.net c#

    Linq to Sql Introduction Entities Ado.Net C# SqlClasses Attributes Linq Mapping

    Linq Programming/How Linq Works?/Linq Implementation In Asp.Net C# Ado.Net

    Performing Developing Using Investigating Asp.Net 2.0 Ajax Application Development Asp.Net C#

    Hosting/Install Wcf Services in a Windows Service Asp.Net C#

    Connecting Silverlight to Wcf Asp.Net C#

    Silverlight Data Grid Data Binding WCF Asp.Net C#

    Invoking/Accessing/Calling WCF Service Without Adding/Creating Proxy/Reference Asp.Net C#

    Performing Doing Creating Insert Update Delete sql data Using Linq Database Asp.Net C#

    Working with xml data type variable sql server 2008 asp.net c#

    Posted by on August 8, 2010 Leave a comment (1) Go to comments

    Introduction:
    In this article,i am going to explain about how to use the new xml data type as variable, and how to
    define the xml data.

    Main:

    The ‘xml’ datatype helps us to declare xml data in sql server 2008.

    DECLARE @xmlData AS XML
    SET @xmlData='
    <Customers>
      <CustomerID>TELRK</CustomerID>
      <CompanyName>Telerik, Inc</CompanyName>
      <ContactName>Stephen Forte</ContactName>
      <ContactTitle>Sales Representative</ContactTitle>
      <Address>5–9 Union Square West</Address>
      <City>New York</City>
      <PostalCode>10028</PostalCode>
      <Country>USA</Country>
      <Phone>030-0074321</Phone>
      <Fax>030-0076545</Fax>
      </Customers>'
    SELECT @xmlData

    How to insert a xml data into table?

    --Insert Static XML via a variable
    DECLARE @xmlData AS XML
    SET @xmlData = '
    <Orders>
      <Order>
        <OrderID>5</OrderID>
        <CustomerID>65</CustomerID>
        <OrderAmount>25</OrderAmount>
      </Order>
    </Orders>'
    --insert into the table
    INSERT INTO OrdersXML (OrderDocID, xOrders) Values (1, @xmlData)

    You can insert XML into these columns in a variety of other ways: XML Bulk Load, loading from an XML
    variable (as shown above),

    How to use xml bulk load?

    In SQL Server 2000, XML Bulk Load allowed users to load large XML documents on the client side.
    XML Bulk Load works by reading the XML and producing SQL INSERT statements that run on the client
    in a batched fashion. SQL Server 2005 and 2008 greatly enhance XML Bulk Load by allowing it to run
    on the server and to load directly into an xml data type column.

    Add a note hereUsing the enhanced XML Bulk Load requires using the system rowset provider function
    OPENROWSET and specifying the BULK provider,

    --create a table with an xml column
    CREATE TABLE tblXmlCustomers
     (CustomerID int PRIMARY KEY IDENTITY,
     
      CustomerXML xml NOT NULL)
     
    --this file will load 1 record in (SINGLE_CLOB); for more records use a format file)
    INSERT INTO tblXmlCustomers)
     SELECT * FROM OPENROWSET(BULK 'C:\customer_01.xml', SINGLE_CLOB) AS XmlData)

    Querying xml data using xquery?

    XQuery provides a native and elegant way to query XML data.

    DECLARE @XML xml
    SET @XML='
    <catalog>
      <book category="ITPro">
        <title>Windows Step By Step</title>
        <author>Bill Zack</author>
        <price>49.99</price>
      </book>
      <book category="Developer">
        <title>Developing ADO .NET</title>
        <author>Andrew Brust</author>
        <price>39.93</price>
      </book>
      <book category="ITPro">
        <title>Windows Cluster Server</title>
        <author>Stephen Forte</author>
        <price>59.99</price>
      </book>
    </catalog>'
     
    SELECT @XML.query('
       for $b in /catalog/book
       where $b/@category="ITPro"
       order by $b/author[1] descending
       return ($b)')

    Conclusion:
    Hope this helps,
    Happy coding.

    ASP.NET
    ← Encrypting Stored Procedure sql server 2008 asp.net c#
    Essentials for Creating/Developing/Programming silverlight project tools wpf xaml →

    Learn Easily Using Video Tutorials


    How to choose the right Java IDE – explained Eclipse NetBeans BlueJ

    Developing/Creating/Performing/Configuring Java Applications Using Eclipse IDE

    Step By Step Guide for Download/Install Configure Eclipse IDE for Java

    Editing data with the GridView control Asp.Net C#

    Registering/Configuring Web Controls globally in web.config file asp.net c#

    Registering/Configuring Web Controls globally in web.config file asp.net c#

    Best way to prepare asp.net Interview - Success Stories

    Download Important Questions and PPT's:

    Sql Server Important Questions Online free download

    Dotnet Important Questions Online free download

    Exploring Linq to Sql Process Flow

    Learn how to perform silverlight programming

    Learn OOPs concepts in better and well manner

    Learn Ajax in better and well manner

    Leave a comment

    1 Comments.

    1. auto poster August 20, 2010 at 4:06 am

      This is Awesome! Thank you so much.

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    *

    *


    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Enter your email address:

    Delivered by FeedBurner

    • Recent Posts

      • Bounty Huge Roll [Amazon Frustration-Free Packaging]
      • XML Introduction to XML VHS Video Training, 1 hr., 32 minutes.
      • The Basic Overview of Windows Mobile Development Asp.Net C#
      • Overview of Sql server extended properties Asp.Net C#
      • How to Use Sql Server Extended properties using visual studio Asp.Net C#
    • Search by Tags!

      Application AspNet Basic between Black Bluetooth Build Business Collection Consultants Design Development Downloading effective Excel Experts Generics Implement Installing Interview Logic Management Microsoft Minutes Object Outlook Professional Programmer Programming Project Projects Questions Ready Select Server Services Silverlight Source Strings Studio Through using Visual Website Wordpress
    • Archives

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

    Copyright © 2012 NetProgrammingHelp.com

    Δ Top