The following query gives me XML output.
select * from myTable FOR XML AUTO
I want to put that XML output into a table containing an XML field type (data field in this case)
CREATE TABLE [dbo].[_xmltest](
[id] [int] IDENTITY(1,1) NOT NULL,
[data] [xml] NOT NULL
) ON [PRIMARY]
I have tried the following but FOR XML is not allowed in INSERT queries.
insert into _xmltext(data)
select * from Security FOR XML AUTO