我需要将 XML 文件导入 SQL Server 2008 R2 数据库。
因此,我使用硬编码的 XML 数据进行了查询:
DECLARE @xml XML
SET @xml='
<goods_item>
<goods_level>1</goods_level>
<goods_isgroup>1</goods_isgroup>
<goods_code>51852</goods_code>
<goods_name></goods_name>
<goods_parent></goods_parent>
<goods_art></goods_art>
<goods_buhart></goods_buhart>
<goods_inpack>0</goods_inpack>
<goods_packtxt></goods_packtxt>
<goods_country></goods_country>
<goods_gtd></goods_gtd>
<goods_nds>0</goods_nds>
<goods_unit></goods_unit>
</goods_item>
<goods_item>
<goods_level>1</g oods_level>
<goods_isgroup>1</goods_isgroup>
<goods_code>51852</goods_code>
<goods_name></goods_name>
<goods_parent></goods_parent>
<goods_art></goods_art>
<goods_buhart></goods_buhart>
<goods_inpack>0</goods_inpack>
<goods_packtxt></goods_packtxt>
<goods_country></goods_country>
<goods_gtd></goods_gtd>
<goods_nds>0</goods_nds>
<goods_unit></goods_unit>
</goods_item>'
它工作正常。但是如何将硬编码 XML 数据更改为 XML 文件的路径?
关于这个:
SET @xml='D:\xml1.xml'