Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 updating a table with OPENXML and metaproperties

Author  Topic 

mwhalen76
Starting Member

1 Post

Posted - 2002-01-18 : 17:20:33
I have a stored procedure that looks like this:

CREATE PROCEDURE updateXML (@pDoc text, @ReportID int)
as
DECLARE @rDoc int

EXEC sp_xml_preparedocument @rDoc OUTPUT, @pDoc

UPDATE tempdata
SET tempdata.CRASH_REPORT_NUM = xmlFile.FormID, tempData.datReport =
xmlFile.newDatReport, tempData.County_City_Code = xmlFile.newCountyCityCode,
tempData.Make1 = xmlFile.newMake, tempData.Owner_Name =
xmlFile.newOwnerName, tempdata.form = xmlFile.newForm
FROM OPENXML(@rDoc, '/formtransmit', 2)
WITH (FormID int 'form/CRASH_REPORT_NUM',
newDatReport datetime 'form/Date',
newCountyCityCode numeric 'form/COUNTY_CITY_CODE',
newMake char(10) 'form/MAKE1',
newOwnerName varchar(40) 'form/Owner_Name',
newForm ntext '@mp:XMLtext') xmlFile
WHERE tempData.Report_ID = @ReportID

EXEC sp_xml_removedocument @rDoc
GO

and it works okay - it puts the correct values in each column except the tempdata.form column. I have an almost identical (no aliases) stored procedure that does an insert and it works fine. So, I'm trying to find out why this doesn't work.
Any suggestions??? Thanks.

   

- Advertisement -