sam-bi,
the following code should help you..
Create table students
(id int, name varchar (20),score int,[status] varchar(10))
insert into students values (1001,'sachin',100,'pass')
insert into students values (1002,'Dravid',90,'pass')
insert into students values (1003,'Dhoni',30,'fail')
insert into students values (1004,'Kohli',29,'fail')
select
'Y' as "@DeleteAllCurrentRecords",
cast((select
'Y' as "@DeleteCurrentRecord",
id,
name,
score,status
from students
for xml path('course')) as xml)
for xml path('courses')
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>
No comments:
Post a Comment