Openrowset

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

create table students(SID int primary key, marks int, grade varchar(5))

insert into Students(SID,Marks,Grade)


select x.stud.query('SID').value('.','int'),
x.stud.query('Marks').value('.','int'),
x.stud.query('Grade').value('.','varchar(5)')
from
(Select cast(x as xml) from openrowset(bulk'c:\students.xml',single_blob)as t(x))
as t(x)cross apply x.nodes('Students/Student')as x(stud);

select * from students

You might also like