表结构
![](/Images/OutliningIndicators/ContractedBlock.gif)
存储过程
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
ALTER procedure [dbo].[Dict2SQL]
as
begin
update Signal set id = id + 1
/* 全部清空数据 */
truncate table en
/* XML入库.Begin */
DECLARE @en TABLE(data XML)
INSERT INTO @en
SELECT CAST(A AS XML) FROM OPENROWSET(BULK N'c:\dict.xml',SINGLE_BLOB) A(A);
DECLARE @docHandle int
DECLARE @xmlDocument nvarchar(max) -- or xml type
SELECT @xmlDocument = CAST(data as NVARCHAR(MAX)) FROM @en
EXEC sp_xml_preparedocument @docHandle OUTPUT, @xmlDocument;
/* 入原始库 */
INSERT INTO en
SELECT * FROM OPENXML(@docHandle, N'/Dictionary/Item',2)
WITH en
EXEC sp_xml_removedocument @docHandle
end
XML格式
![](/Images/OutliningIndicators/ContractedBlock.gif)