Lexicon
Lexicon

Reputation: 2625

Schedule SQL Server query to execute and output a file

Alright guys, this should 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

Upvotes: 1

Views: 12585

Answers (2)

Mark Brackett
Mark Brackett

Reputation: 85665

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.

Upvotes: 11

gbn
gbn

Reputation: 432561

Look at bcp.exe scheduled via Windows for possibly the simplest way...

Upvotes: 1

Related Questions