Monday, February 20, 2012

Problem with Dates and OpenXML command

My data is being updated correctly for all fields except a date field.
The program is crashing when a date is encountered with OpenXML. Is
there a way to convert the date within SQL to handle this...I have tried
the CONVERT statement below, but it does little
UPDATE EducationSheetSchool
SET
EducationSheetSchool.Address= XMLEducationSheetSchool.Address,
EducationSheetSchool.[Name]= XMLEducationSheetSchool.[Name],
EducationSheetSchool.LEA= XMLEducationSheetSchool.LEA,
EducationSheetSchool.Tel= XMLEducationSheetSchool.Tel,
EducationSheetSchool.Email= XMLEducationSheetSchool.Email,
EducationSheetSchool.Start=CONVERT(varchar(30),XML EducationSheetSchool.S
tart, 126),
*** Sent via Developersdex http://www.codecomments.com ***
Can you show a sample of the XML and the OPENXML syntax you're using?
Adam Machanic
Pro SQL Server 2005, available now
www.apress.com/book/bookDisplay.html?bID=457
"Paul Barnett" <barnettpaul@.gmail.com> wrote in message
news:eCtAwfM4FHA.1188@.TK2MSFTNGP12.phx.gbl...
>
> My data is being updated correctly for all fields except a date field.
> The program is crashing when a date is encountered with OpenXML. Is
> there a way to convert the date within SQL to handle this...I have tried
> the CONVERT statement below, but it does little
>
> UPDATE EducationSheetSchool
> SET
> EducationSheetSchool.Address= XMLEducationSheetSchool.Address,
> EducationSheetSchool.[Name]= XMLEducationSheetSchool.[Name],
> EducationSheetSchool.LEA= XMLEducationSheetSchool.LEA,
> EducationSheetSchool.Tel= XMLEducationSheetSchool.Tel,
> EducationSheetSchool.Email= XMLEducationSheetSchool.Email,
> EducationSheetSchool.Start=CONVERT(varchar(30),XML EducationSheetSchool.S
> tart, 126),
> *** Sent via Developersdex http://www.codecomments.com ***

No comments:

Post a Comment