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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 schedule Export sql result set to text file

Author  Topic 

kshahzad
Starting Member

45 Posts

Posted - 2013-07-04 : 14:21:29
i have a query,

i want to run it every 15 minutes and export the result in text file to a different folder,

Please assist.

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-07-04 : 17:12:13
Create an SSIS package (can use Import/Export Wizard if it is simple exporting of data to a text file) where the input will be the result of the query and the output will be the text file. Then schedule the package to run every 15 minutes using SQL Server Agent.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-07-05 : 01:48:33
if you dont have any intermediate transformation logic, you can also use bcp as an option for this
Add a T-SQL procedure to bcp out the required data from table or query and then add a job in sql server agent to execute the procedure in every 15 mins as you want.

see

https://www.simple-talk.com/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -