I have this code in SQL query:
CREATE TABLE Products(
P VARCHAR(30));
Select *
from products
Declare @x xml
Select @x=P
from openrowset (BULK 'C:\Pantanir.xml', Single_blob) AS Products(P)
Select @x
Where P is an column in table products. With this i only import the XML file into my database but i wont to create a table with something like this, but this does not work.
from openxml (@hdoc, '/reservation',1)
with ('Someattribute')
A part of my XML file is shown below. I want to create two columns(ReservationNo and SecurityCode) and take the values from the XML file and import them into an SQL table. Is that possible ?
<reservation>
<reservationNo>9833591189</reservationNo>
<securityCode>ad4badfd56</securityCode>