0

Good Day All

I have the Following Query

DECLARE @CurrentTime DATETIME
SET @CurrentTime = CURRENT_TIMESTAMP
select tr.Descr [Room], tb.Purpose [Purpose], tb.Description [Description],
convert(varchar,datepart(hour,tb.starttime))+':'+convert(varchar,datepart(minute,tb.starttime)) [Start Time],
convert(varchar,datepart(hour,tb.endtime))+':'+convert(varchar,datepart(minute,tb.endtime)) [End Time],
tu.name [Requested by] from tbl_booking tb inner join tbl_resource tr
on tb.resources = tr.id
inner join tbl_user tu on tu.id = tb.RequestedByUser
where (day(startdate) = day(@CurrentTime))and(month(startdate)=month(@CurrentTime))and(year(startdate)=year(@CurrentTime))and(tb.status=1)
order by [Room],[Start Time]
for xml raw

This creates an XML, but now i want to store it in

C:\X.XML

how can i BCP this Query

Thanks

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by vuyiswamb
0

Why don't you handle this task at the application layer instead of the DB layer? Often time the MSSQL Service is not running with administrative rights and does not have filesystem access to the root drive of the disk, ie C:\

0

Good Morning

This is not an Application, so i will not have a BLL or DAL. i have all the Rights to write to the File System. all i need is help to BCP the given query

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.