Never needed to do much with XML before on SQL Server but it's becoming a requirement.
I want to take the contents of a standard T-SQL query and push it into an XML field. I exepcted the following to be valid:-
INSERT INTO MyTable(MyXMLField)
SELECT * FROM MyFile
FOR XML AUTO, ELEMENTS
...but I get an error message stating INSERT INTO cannot be used with INSERT INTO. Whats the best way to do this and more importantly, whats the point of the FOR XML clauses if you cannot use them as a basis for input into an XML field?
I think I'm missing something obvious here.
Dazed and confused
I want to take the contents of a standard T-SQL query and push it into an XML field. I exepcted the following to be valid:-
INSERT INTO MyTable(MyXMLField)
SELECT * FROM MyFile
FOR XML AUTO, ELEMENTS
...but I get an error message stating INSERT INTO cannot be used with INSERT INTO. Whats the best way to do this and more importantly, whats the point of the FOR XML clauses if you cannot use them as a basis for input into an XML field?
I think I'm missing something obvious here.
Dazed and confused