944,153 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Unsolved
  • Views: 658
  • MS SQL RSS
Nov 2nd, 2009
0

Help BCP The Following Query

Expand Post »
Good Day All

I have the Following Query
MS SQL Syntax (Toggle Plain Text)
  1. DECLARE @CurrentTime DATETIME
  2. SET @CurrentTime = CURRENT_TIMESTAMP
  3. SELECT tr.Descr [Room], tb.Purpose [Purpose], tb.Description [Description],
  4. convert(varchar,datepart(hour,tb.starttime))+':'+convert(varchar,datepart(minute,tb.starttime)) [Start Time],
  5. convert(varchar,datepart(hour,tb.endtime))+':'+convert(varchar,datepart(minute,tb.endtime)) [End Time],
  6. tu.name [Requested BY] FROM tbl_booking tb INNER JOIN tbl_resource tr
  7. ON tb.resources = tr.id
  8. INNER JOIN tbl_user tu ON tu.id = tb.RequestedByUser
  9. WHERE (day(startdate) = day(@CurrentTime))AND(month(startdate)=month(@CurrentTime))AND(year(startdate)=year(@CurrentTime))AND(tb.STATUS=1)
  10. ORDER BY [Room],[Start Time]
  11. FOR xml raw

This creates an XML, but now i want to store it in
Quote ...
C:\X.XML
how can i BCP this Query

Thanks
Similar Threads
Reputation Points: 31
Solved Threads: 14
Posting Whiz
vuyiswamb is offline Offline
310 posts
since Mar 2007
Nov 2nd, 2009
0
Re: Help BCP The Following Query
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:\
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Nov 3rd, 2009
0
Re: Help BCP The Following Query
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
Reputation Points: 31
Solved Threads: 14
Posting Whiz
vuyiswamb is offline Offline
310 posts
since Mar 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS SQL Forum Timeline: Extract table statistics DDL
Next Thread in MS SQL Forum Timeline: insert date





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC