我需要将以下 XML 导入 SQL Server 2008 R2:
<Role
ID="ef63f979-c65d-421a-a214-7319c6279e13" >
<Privileges>
<Privilege ID="1" />
<Privilege ID="2" />
<Privilege ID="3" />
<Privilege ID="4" />
<Privilege ID="5" />
</Privileges>
</Role>
我可以使用表变量来执行此操作并解析 XML 两次,但无法在一次解析中将其放入关系表中。那可能吗?这是预期的结果集:
EF63F979-C65D-421A-A214-7319C6279E13 1 2011-12-05 06:51:11.9065096 EF63F979-C65D-421A-A214-7319C6279E13
EF63F979-C65D-421A-A214-7319C6279E13 2 2011-12-05 06:51:11.9065096 EF63F979-C65D-421A-A214-7319C6279E13
EF63F979-C65D-421A-A214-7319C6279E13 3 2011-12-05 06:51:11.9065096 EF63F979-C65D-421A-A214-7319C6279E13
EF63F979-C65D-421A-A214-7319C6279E13 4 2011-12-05 06:51:11.9065096 EF63F979-C65D-421A-A214-7319C6279E13
EF63F979-C65D-421A-A214-7319C6279E13 5 2011-12-05 06:51:11.9065096 EF63F979-C65D-421A-A214-7319C6279E13
谢谢,
拉吉