Schedule SQL Server query to execute and output a file
Alright guys, this shoul开发者_如何转开发d be a very simple request. I'd like to run a query (IE Select * from tablex
) every night and have it automatically output to a text file on the same system.
Thanks
Create a new SQL Server Agent job, in the step put in your SELECT statement. In Advanced, tell it to output to a file. Done.
Look at bcp.exe scheduled via Windows for possibly the simplest way...
精彩评论