Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sross81
Posting Yak Master
228 Posts |
Posted - 2009-05-22 : 13:39:16
|
| Hello,I have a query that I want to have it automtically create like csv or text file out at a specific file directory when it runs. Is there a way to do this?SELECT a.first_name, a.last_name,cast(a.date_of_birth as datetime) as DOB,a.language, cast( b.appt_date as datetime) as ApptDate,convert(datetime,stuff(b.begintime,3,0,':')) as begintime,b.cancel_ind, c.location_name, d.description, e.eventFROM person aJOIN appointments b ON a.person_id = b.person_idJOIN provider_mstr d ON b.rendering_provider_id = d.provider_idJOIN location_mstr c ON b.location_id = c.location_idJOIN events e ON b.event_id = e.event_idwhere b.appt_date >= @startdate and b.appt_date <=@enddateSo for example I want the results of this query to go to a file location like:U:\Departments\Phone Tree Report and have it save as a text or csv file and it would be nice if I could add the current date to the end of the file or just overwrite the last one that is out there. Is this something that can be done with SQL?Thanks in Advance!Sherri |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
sross81
Posting Yak Master
228 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-05-22 : 14:02:21
|
| welcome |
 |
|
|
|
|
|
|
|