Yes, it is possible, do the following:
CREATE TABLE XMLwithOpenXML
(
Id INT IDENTITY PRIMARY KEY,
XMLData XML,
LoadedDateTime DATETIME
)
INSERT INTO XMLwithOpenXML(XMLData, LoadedDateTime)
SELECT CONVERT(XML, BulkColumn) AS BulkColumn, GETDATE()
FROM OPENROWSET(BULK 'c:\seuarquivo.xml', SINGLE_BLOB) AS x;
SELECT * FROM XMLwithOpenXML
Once this is done, you will create a table to store the contents of your XML.
Now to read this content I made a test with your file:
DECLARE @XML AS XML, @hDoc AS INT, @SQL NVARCHAR (MAX)
SELECT @XML = XMLData FROM XMLwithOpenXML
EXEC sp_xml_preparedocument @hDoc OUTPUT, @XML
select @xml
SELECT [Key], [Value]
FROM OPENXML(@hDoc, 'DatabaseNoteTakerProject/Project/Setting')
WITH
(
[key] [varchar](50) '@key',
[value] [varchar](100) '@value'
)
EXEC sp_xml_removedocument @hDoc
GO
I got as a result: (which are part of your XML)
saveConnectionSettingsSeparately False
saveOneFilePerObject False
saveObjectHistory True
publishPath
publishXSLPath
includeFilter NULL
excludeFilter NULL
More information and details can be found here:
https://www.mssqltips.com/sqlservertip/2899/importing-and-processing-data-from-xml-files-into-sql-server-tables/
It worked, I had a little trouble understanding the return of the result. What I wanted was the feedback of the msm comments, I had to make changes to the path and keys. Thank you very much
– Gustavo Forte Andreli
wonder... really Voce has to go on "nail" and do one to one pq xml is not standard.. Msa after you do the first good! abs
– Thiago Loureiro
At the discretion of those who wish, in the search for other information, I found a tool that makes this dictionary inside the SQL Server itself, not having the need to import the XML, only it is paid: [link] (https://www.red-gate.com/products/sql-development/sql-compare/)
– Gustavo Forte Andreli