June 6, 2011 at 3:12 pm
If I wanted to implement something in SQL Server 2005 that would take the results from a query, specifcially a view, and save them to a plain old ASCII text file with the file extension of 'prn', and do it
a) On a recurring schedule
b) without Using SSIS
How would I do it?
I have a query in place that will produce the results; a single column that is the concatenation of several pieces of varchar & char data. I'd like to send the results to a prn file and on a schedule if possiobel without usiing SSIS. Any suggestions?
Thanks
Kindest Regards,
Just say No to Facebook!June 6, 2011 at 3:21 pm
a) On a recurring schedule
Using Google "sql server scheduled job"
You should get About 285,000 results (0.16 seconds)
b) without Using SSIS
Use Google "SQL Server Bulk Export"
You should get About 220,000 results (0.35 seconds) .
June 6, 2011 at 4:43 pm
bitbucket-25253 (6/6/2011)
a) On a recurring scheduleUsing Google "sql server scheduled job"
You should get About 285,000 results (0.16 seconds)
b) without Using SSIS
Use Google "SQL Server Bulk Export"
You should get About 220,000 results (0.35 seconds) .
Thanks for the recomendation of looing at Bulk Exporting. I've never used BCP before (we've always used a third party tool for import & export in bulk) and so it wasn't as obvious to me that it would be a possible solution. I was fully expecting to get 'You Gotta Use SSIS' replies only.
Luckily I managed to find a workable sample script to go from but searching Google, while returning many, many rows, was definately not quick. It took some time to find a simple, sample piece of T-SQL that could be dropped inside as SQL Job.
Thanks
Kindest Regards,
Just say No to Facebook!June 7, 2011 at 9:42 am
SqlCmd is an alternative to BCP that offers a bit more control if you need to output column headers.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
October 6, 2011 at 3:30 am
does your script cater for saving in xls format as i have a similar problem?
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply