SQL SERVER – Understanding XML – Contest Win Joes 2 Pros Combo (USD 198) – Day 5 of 5

SQL SERVER - Understanding XML - Contest Win Joes 2 Pros Combo (USD 198) - Day 5 of 5 combos

August 2011 we ran a contest where every day we give away one book for an entire month. The contest had extreme success. Lots of people participated and lots of give away. I have received lots of questions if we are doing something similar this month. Absolutely, instead of running a contest a month long we are doing something more interesting. We are giving away USD 198 worth gift every day for this week. We are giving away Joes 2 Pros 5 Volumes (BOOK) SQL 2008 Development Certification Training Kit every day. One copy in India and One in USA. Total 2 of the giveaway (worth USD 198). All the gifts are sponsored from Joes 2 Pros.

The books are available here Amazon | Flipkart 

How to Win:

  • Read the Question
  • Read the Hints
  • Answer the Quiz in Contact Form in following format
    • Question
    • Answer
    • Name of the country (The contest is open for USA and India residents only)
  • 2 Winners will be randomly selected announced on August 20th.

Question of the Day:

Is following XML a well formed XML Document?

<?xml version=”1.0″?>
<address>
<firstname>Pinal</firstname>
<lastname>Dave</lastname>
<title>Founder</title>
<company>SQLAuthority.com</company>
</address>

a) Yes
b) No
c) I do not know

Query Hints:

BIG HINT POST

A common observation by people seeing an XML file for the first time is that it looks like just a bunch of data inside a text file. XML files are text-based documents, which makes them easy to read.  All of the data is literally spelled out in the document and relies on a just a few characters (<, >, =) to convey relationships and structure of the data.  XML files can be used by any commonly available text editor, like Notepad.

Much like a book’s Table of Contents, your first glance at well-formed XML will tell you the subject matter of the data and its general structure. Hints appearing within the data help you to quickly identify the main theme (similar to book’s subject), its headers (similar to chapter titles or sections of a book), data elements (similar to a book’s characters or chief topics), and so forth. We’ll learn to recognize and use the structural “hints,” which are XML’s markup components (e.g., XML tags, root elements).

The XML Raw and Auto modes are great for displaying data as all attributes or all elements – but not both at once. If you want your XML stream to have some of its data shown in attributes and some shown as elements, then you can use the XML Path mode. If you are using an XML Path stream, then by default all values will be shown as elements. However, it is possible to pick one or more elements to be shown with an attribute(s) as well.

Additional Hints:

I have previously discussed various concepts from SQL Server Joes 2 Pros Volume 5.

Next Step:

Answer the Quiz in Contact Form in following format

  • Question –
  • Answer
  • Name of the country (The contest is open for USA and India)

Bonus Winner

Leave a comment with your favorite article from the “additional hints” section and you may be eligible for surprise gift. There is no country restriction for this Bonus Contest. Do mention why you liked it any particular blog post and I will announce the winner of the same along with the main contest.

Reference: Pinal Dave (https://blog.sqlauthority.com)

Joes 2 Pros
Previous Post
SQL SERVER – Expanding Views – Contest Win Joes 2 Pros Combo (USD 198) – Day 4 of 5
Next Post
SQL SERVER – Contest – Summary of 5 Day and Additional Information

Related Posts

9 Comments. Leave new

  • Hi Pinal,

    Nice article.. I have known lot of things from article about XML by reading this article ……

    Thanks,
    Vijayakumar P

    Reply
  • Ans:- a) Yes

    Additional Hints:

    SQL Joes 2 Pros Development Series – What is XML?

    Reason is basically i’m not familiar with XML due to this contest it forced me to learn basics of XML.when i was see today’s question my first feeling was oh! i couldn’t answer correct one but as i found your links it lands me to learn every thing related to XML and i personally thanks to giving me this chance to pick up new technology…!!!!

    Thanks
    Ganesh N

    Reply
  • Hi Pinal,

    I liked your blog
    SQL Joes 2 Pros Development Series – Preparing XML in Memory
    In this you have mentioned very well regarding how can we pass XML data and use in sql statement.

    Best Regards,
    S Kumar

    Reply
  • B)no
    country: india

    Reply
  • P.Anish Shenoy
    August 13, 2012 12:57 pm

    Hi Sir,

    Complete XML section was soooooper, but in particular

    SQL Joes 2 Pros Development Series – Preparing XML in Memory

    blog post one of my favourite.

    Regards,
    P.Anish Shenoy
    Bangalore.

    Reply
  • I like SQL SERVER – Tips from the SQL Joes 2 Pros Development Series – What is XML? – Day 30 of 35 because it has practical guidance more and i knew the function FOR XML PATH() dn’t know about FOR XML RAW ,ROOT , ELEMENTS , and Specially XSINIL.

    Reply
  • Kalyanasundaram.K
    August 13, 2012 8:28 pm

    Hi,

    Its my favorite link from additional hints section :
    SQL Joes 2 Pros Development Series – Using Root With Auto XML Mode

    Reason : Its something different for all SQL guys, to learn different things in this series for XML manipulation. Also, using Auto mode to create xml file in simpler process.

    Reply
  • Uday Bhoopalam
    August 14, 2012 9:44 pm

    Hi Pinal,
    Yes. It is a well formed xml. The subject matter in this example is Address which is the root tag. The root as well as the elements have a opening tag, closing tag and are nested properly.

    Country: USA

    Reply

Leave a Reply