cxml = STRTRAN(STRTRAN(cXml, "true", "1"), "false", "0")> When I pass a XML string generated by vfp9 function cursortoxml() to a SQL SERVER 2000 stored procedure for parsing with openxml(),encountered a problem that Datetime data & Logic data is not able to be parsed into related rowset columns defined with colpattern patameters by respective Datetime and Bit field-type.Via checking the XML string at side of VFP,found a 'T' was inserted between the Date portion and time portion of datetime-type data i.e.
> create cursor tmp ( f1 t, f2 L) > INSERT INTO tmp values(DATETIME(),.t.) > INSERT INTO tmp values(DATETIME(),.f.) > select tmp > BROWSE > ?CURSORTOXML("tmp","cxml",1,0,0) > ?cxml > ?SQLEXEC(_screen.sqlhnd,"exec ReadXml ?cxml",'sql_cur') && set your own SQL handle > select sql_cur > BROWSE >>SQL SP:-
> CREATE PROCEDURE ReadXML > ( > @xml text > ) > as > declare @xdoc int > exec sp_xml_preparedocument @xdoc output, @xml > select a.* from openxml (@xdoc, '/VFPData/tmp', 2) with (f1 datetime,f2 bit) as a > exec sp_xml_removedocument @xdoc > GO >> However,if
... with (f1 datetime,f2 bit) ...is rewrited as
... with (f1 varchar(20),f2 varchar(10)) ...
> the procedure can perform with no problem.