Friday, February 24, 2012

Date field not getting uploaded

I have an xml field with date as follows.
<dates>2005-03-03</date>
I tried to upload it to SQL table. My column is defined as datetime.
I wrote schema as,
<xsd:element name="dates" type="xsd:date"/>
But after I use bulkload and execute in VB, the SQL column has a null value.
So, I changed my xml data as,
<dates>2005-03-03T12:04:05</dates>
Even after changing this and executing I only get value in SQl column.
How do I load dates into SQL?
Regards
MeenaTry adding a Z to the end - SQL server demands timezones...
<dates>2005-03-03T12:04:05Z</dates>
This also suggests you are swallowing an exception somewhere, as this
should have raised an error?
Marc|||I tried adding an Z at the end.
But still data is not getting loaded into SQL table.
Any help?
Regards
Meena
"Marc Gravell" <marc.gravell@.gmail.com> wrote in message
news:uuZPTSHxHHA.3944@.TK2MSFTNGP06.phx.gbl...
> Try adding a Z to the end - SQL server demands timezones...
> <dates>2005-03-03T12:04:05Z</dates>
> This also suggests you are swallowing an exception somewhere, as this
> should have raised an error?
> Marc
>|||I tried adding an Z at the end.
But still data is not getting loaded into SQL table.
Any help?
Regards
Meena
"Marc Gravell" <marc.gravell@.gmail.com> wrote in message
news:uuZPTSHxHHA.3944@.TK2MSFTNGP06.phx.gbl...
> Try adding a Z to the end - SQL server demands timezones...
> <dates>2005-03-03T12:04:05Z</dates>
> This also suggests you are swallowing an exception somewhere, as this
> should have raised an error?
> Marc
>

No comments:

Post a Comment