I am new at this so please bear with me. I am using MS SQL and am trying to transfer data from my xml document to SQL. I have two questions.
Question #1: I have an error for 'where'. If I remove the where line completely the error moves onto 'session'.
Question #2: I want the aptly named datetime column to feature a datetime data type. When I look at the xml document though I see that there is a T for what datetime equals. I believe this T symbolizes the word time. I am worried that this T will cause problems since I have never seen the data type datetime in SQL having a letter in the middle of the date and time. Is this a possibility? If so what should I do? I assume that I will have to change my data type if there is a problem (what should it be changed to if so?). Changing the xml document itself to remove the T is not an option.
OP here. I have found the answer to Question #2. the T won't be a problem.
>>269439
Re 1, the body of a SELECT WITH should be another valid SELECT statement.
And it goes at the front (WITH blah SELECT), not the back (SELECT WITH blah).
>>269439
The problem was solved by putting 'where', 'sessions', and 'datetime' in brackets.