Home > Archive > MS SQL XML > October 2006 > XML / XML Data Type Question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author XML / XML Data Type Question
Amos Soma

2006-10-28, 7:30 pm

Say I have the following T-SQL:

Declare @Doc xml
Declare @Table Table (ItemType nvarchar(10),UserTyp
e nvarchar(20), UserCount
int)

Set @Doc = '
<row ItemType="UserCount" UserType="Corporate" UserCount="0"/>
<row ItemType="UserCount" UserType="External Billable" UserCount="0"/>
<row ItemType="UserCount" UserType="External Non-Billable" UserCount="9"/>
<row ItemType="UserCount" UserType="Internal Billable" UserCount="71"/>
<row ItemType="UserCount" UserType="Internal Non-Billable" UserCount="0"/>
<row ItemType="UserCount" UserType="Leadership Center" UserCount="0"/>'

Can someone show me the T-SQL statement needed to take the 6 rows in the XML
variable @Doc and insert them into the Table variable @Table?

Thanks very much - Amos.


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com