I have an XML datatype and want to convert an element into a sql DateTime variable. How?
e.g.
Declare @Xml Xml Set @Xml = '<Root><DateFrom>2008-10-31T00:00:00</DateFrom></Root>' Declare @DateFrom DateTime Set @DateFrom = ?????
How can I set @DateFrom with the date from the xml above?
I highly recommend you look at the
.nodesfunctionality of the XML data type. The above code pulls out the value of the DateFrom element and converts it to Date Time format.