我的数据库字段是
Id which is primary key and auto increment
imagename varchar(max)
imagepath varchar(max)
isdeleted bit
现在我正在使用 openxml 进行批量插入。它在 imagename 和 imagepath 列中插入空值。这是我的存储过程:
alter PROCEDURE PB_Insertgallery
@XmlString nText
AS
BEGIN
SET NOCOUNT ON;
DECLARE @XMLDocPointer INT
EXEC sp_xml_preparedocument @XMLDocPointer OUTPUT, @XmlString
INSERT INTO tb_gallery
(imagename, imagepath)
SELECT imagename,imagepath
FROM OPENXML(@XMLDocPointer,'/NewDataSet/Table1',2)
WITH (imagename VARCHAR(max), --'@ImageName',
imagepath VARCHAR(max) --'@ImagePath'
)
EXEC sp_xml_removedocument @XMLDocPointer
END
GO
xml字符串是:
<NewDataSet>
<Table1>
<Imagename>Chrysanthemum.jpg</Imagename>
<Imagepath>/prop_images/temp/Chrysanthemum.jpg</Imagepath>
</Table1>
</NewDataSet>
请帮帮我;为什么我在插入期间得到空值?